I'm creating a custom Button component in react.js. I was wondering if having onClick={null} on a HTML button would create unnecessary event listeners that I don't need?
<button value="test" onClick={onClickHandler} onSubmit={onSubmitHandler}/>
I would use this technique if that is the case:
<button value="test" {...(onClickHandler && {onClick:onClickHandler})} {...(onSubmitHandler && {onSubmit:onSubmitHandler})}/>
If your looking to make the button unclickable after a certain event, just make sure its disables after that event.
<button value="test" onClick={null} disable={valuable onevent here set it to true} />