React Disable button
Recently I did a code challenge where the task was to update a text editor with disable add button and/or remove button when need.
Here is the task.
Append Button
— disabled when the Word Input is empty
Undo Button
— disabled when the current text content of the editor is empty
Expected Behavior
When the Word Input has a non-empty value and the Append Button is clicked, the Word Input is emptied so its value becomes “”. Additionally, the word typed in the input must appear in the content of Text Field as the last word, where the content of the Text Field consists of all typed words that have not been undone, joined by a single space character.
When the Undo Button is clicked, the last appended and not already undone word from the content of the Text Field is removed (along with the space character preceding it if it exists).

append and undo buttons are disable because there is no input and no content

once there is an input append button is active but undo button is disable because there is not content yet.

once there is a content undo button is active but append button is disable because there is not input.
