react-input-trigger
react-input-trigger copied to clipboard
Cant set endTrigger with React Hook useState
I am using a functional component and I am unable to set the endTrigger with a set state function
<InputTrigger
trigger={{
keyCode: 50,
shiftKey: true,
}}
onType={toggleSuggesting}
onCancel={toggleSuggesting}
endTrigger={setEndMention}
>
Did you manage this @fullstackedkush ?
I did not unfortunately, I used useRef to set a reference and created my own trigger to reset it with ref.current.resetState();
@fullstackedkush Had to assign to a variable to make it work, not the best solution, but it works. I'll change to your solutions, seems much cleaner to me.