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
Source: stackoverflow.com
Related Query
- How can i dynamically disable a Fluent UI button?
- How I can disable a button in React js for 5 seconds after click event
- How to disable login button on a dynamically rendered form
- How can I disable a particular button after click, in a buttons array?
- Using Redux Form, how can I disable the submit button if no fields have been filled out?
- How can I disable the button at the end of this component?
- How can I disable a button given a predicate
- React JS, how can I disable an individual button in a mapped list?
- How can I use state to disable only the button I clicked
- Upon clicking a button, how can I input the text from the button into an alert? (And how to disable and leave buttons selected)
- How can I disable the button in design as well?
- How can I disable a button only if specific Input is empty?
- How can i change button style dynamically in React?
- How I can disable a button in React js for 20 seconds after click
- How can I disable back button in React Router?
- How to disable a button when an input is empty?
- How to disable button in React.js
- How to disable the hover effect of material-ui button inside of a styled component
- How can I disable all typescript type checking?
- How to know if react-router can go back to display back button in react app
- redux-form: How to disable submit button if at least one Field is not valid?
- How can I get an input's value on a button click in a Stateless React Component?
- How can I dynamically load an icon using its snake_case name (React, material-ui)
- How can I find and click a button that has no text using React Testing Library?
- How can I conditionally disable a control in Storybook based on the value of another argument?
- How to conditionally disable the submit button with react-hook-form?
- How can I disable chunk(code splitting) with webpack4?
- How can I disable cache on a specific page only in Next.JS
- How to disable form submit button until all input fields are filled?! ReactJS ES2015
- How can I update Material UI theme dynamically via Redux store?
More Query from same tag
- Why is React useEffect clean-up function being run right after the useEffect callback, and then never again?
- Gatsby Deploy With GH-Pages and --Path-Pefix Is Broken
- Yup validataion not working on condition based on another field condition
- javascript fetch cors error with java server
- How to pass props to row in react-table
- React TypeScript 16.8 Passing Props with BrowserRouter
- Deploy static website to Google Cloud made with Gatsby
- React call Component dynamically from array of strings
- Usage of State in functional component of React
- SyntaxError: Unexpected token < in JSON at position 0 API GET
- FCC Drum Machine - Passing tests but keydown event not firing for me
- Getting and setting values from Redux Store with Redux Saga
- gatsby-node.js multiple api calls
- How to force web page zoom at 100% ReactJS
- Beginner - Callback function after dangerouslySetInnerHTML
- React Material UI Table Name Sorting seems little bit off
- React + React highlight. Code highlighting
- How to deal with custom font and fontWeight with react-native
- how to call the useContext function?
- How to get and pass deviceKey in social login using Cognito and AWS Amplify?
- Nothing is displayed when I change the code of component in Reactjs?
- React return within render
- How to toggle a checkbox in a row of a antd table?
- Lodash debounce with React Input
- change value of input made with react from chrome extension
- Is it possible to extract the name of a nested arrays?
- Gatsby - page refresh corruption
- UI not updating after userReducer changes state
- Warning: Encountered two children with the same key for react infinite scroll
- My CSS grid layout causes horizontal scroll and I can't figure out why