I have three components.
SearchBarInputwhich is a controlled component based on Material UI OutlinedInput. As props it takesonClickClear.Inputwhich renders theSearchBarInputand passes to it theonClickClearAppwhich renders theInputcomponent and passes to it ahandleClickClearfunction.
Code: https://codesandbox.io/s/amazing-allen-fprpd
When the user inputs anything in the Input, an X icon appears. If the user clicks it, it sets the state of the input to undefined. Thus, the state is correctly cleared.
However, it does not clear the UI of the input from what the user has typed.
What I am trying to achieve is a similar behaviour of <input type="search"> in plain html
See:
