componentDidMount() {
        // this.inputElement.focus();
        this.inputElementRef.current.focus(); // need to use current!

        // Accessing contextType
        console.log('contextType: ', this.context);
    }
// Can be used only in CLASS based Components
Can be used only in CLASS based Components
Can be used only in CLASS based Components
componentDidMount() {
        this.inputElementRef.current.focus(); 
        console.log('contextType: ', this.context);
    }
componentDidMount ( ) { this . inputElementRef . current . focus ( ) ; console . log ( 'contextType: ' , this . context ) ; }
Can be used only in CLASS based Components
Can be used only in CLASS based Components
// this.inputElement.focus(); // need to use current! // Accessing contextType