react component class variable access

Viewed 1521

How do I access this the_frame variable?

export default class oneApp extends React.Component {
    constructor (props) {
        super(props);
        const the_frame = document.getElementsByClassName("frame")[0];
    }

    oneFunc() {  
        the_frame.style.display = "none"; // How do I access the_frame ?
    }

    twoFunc() {
        the_frame.style.display = "block"; 
    }

    render() {
        return (
            <div className="frame">Hello World</div>
        )
    }
}

I also tried this.the_frame = document.getElementsByClassName("frame")[0]; but can't access the_frame. Thanks

2 Answers
Related