I have an input field and I handle the input via onKeyUp (as I need to access event.which
). This works great so far as I just grab the content of the input via event.target.value
but I run into issues when I try to reset the value of the input field.
I'm using functional components, so accessing the input via refs isn't possible and all examples I found with useRef just show how to focus the input field but not how to clear it.
I forgot to mention that I'm using Material-UI.