People on StackOverflow seem to have many opinions about it, and indeed there are two main ways of doing this:. Another way to check is to inline the function, so that the condition will be checked on every render (every props and state change) const isDisabled = () => // condition check. I added a condition (name.value.length === 0 || email.value.length === 0) This disables the button on load but when values are input in the text fields the disabled is not removed. The nameChange() function is used to update the name property with the user-entered data.. Solved: Disable button if pen input/gallery blank/empty - Power ... How to use it: 1. Develop smarter with the visual UI Editor, IDE, JavaScript, Velo APIs and more. Just as amusement, you can do this in just CSS and html, reference Matching an empty input box using CSS. Disable ButtonForm recipe: Conditionally disabling the Submit button Learn how to disable or enable buttons based on whether or not an input field is empty. angular disable button if field empty code example Consider we have an input field,