I have this component:
import React from \'react\'; export default class AddItem extends React.Component { add() { this.props.onButtonClick(this.input.
very simple solution for this is by using useRef hook
useRef
const buttonRef = useRef(); const disableButton = () =>{ buttonRef.current.disabled = true; // this disables the button } Add
Similarly you can enable the button by using buttonRef.current.disabled = false
buttonRef.current.disabled = false