set the prompt value to a variable
const promptValue = prompt(('enter my name')
and than Use it in the sethayko(promptValue)
hook onClick like
<button onClick={() => sethayko(promptValue)}> Change me </button>
CLICK HERE to find out more related problems solutions.