Categories
React Answers

How to disable button in React?

Spread the love

Sometimes, we want to disable button in React.

In this article, we’ll look at how to disable button in React.

How to disable button in React?

To disable button in React, we can set the disabled prop.

For instance, we write

<button disabled={value}>button</button>;

to set the disabled prop to the value state.

Conclusion

To disable button in React, we can set the disabled prop.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *