How to disable button in React.js

后端 未结 8 1803
迷失自我
迷失自我 2020-12-01 04:06

I have this component:

import React from \'react\';

export default class AddItem extends React.Component {

add() {
    this.props.onButtonClick(this.input.         


        
8条回答
  •  情话喂你
    2020-12-01 04:33

    I have had a similar problem, turns out we don't need hooks to do these, we can make an conditional render and it will still work fine.

    
    

提交回复
热议问题