score:1

Accepted answer
import { primarybutton as fluentuibutton } from 'office-ui-fabric-react';

export class app extends react.component {

  this.state = {disabled:false};

  render() {  
    return (
       <fluentuibutton text={"click me!"} disabled={this.state.disabled} />
    );
  }

  invert() {
    settimeout( () => {
      this.setstate({disabled:true})
    }, 2000)
  }

  componentwillmount() {
    this.invert();
  }

}

you are not using any state variable using state variables and set state you can do that. https://reactjs.org/docs/state-and-lifecycle.html


Related Query

More Query from same tag