Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

Conversation

@whsu00
Copy link

@whsu00 whsu00 commented Sep 23, 2020

No description provided.

onChange={(e) => {
setValue(e.target.value);
}}
onPaste={submit}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not work, because the value state would not have updated in the submit closure. You want to write a handlePaste that calls submitValue with the pasted value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh how I've missed the javascript event loop..

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants