How to handle keypress event in React?

Sir How to handle Key press event in React. I have found one solution but not properly working with API Call. In this case I want to post data to database with post API and axios. But it is not post any value.
But when I press enter key with blank input field it is posting blank value only.
=>The api is working properly in onClick method
=> Find Solution for this problem for last three days please help me with proper Answer. I have already searched google YT so much for the solution. please help me

See how it is taking blank input only with keyPress event funtion

I usually use onKeyPress or OnKeyChange events to listen for enter key press event for a particular input.

I am unable to see the complete file to debug the code properly. In case you still have not solved this problem yet, revert back with Github repo link