-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: respond to events #1083
docs: respond to events #1083
Conversation
|
||
Yes. Event handlers are the best place for side effects. | ||
|
||
Unlike rendering functions, event handlers do not need to be [pure](../describing/pure_components.md), so it’s a great place to change something. For example, you can change an input’s value in response to typing, or change a list in response to a button press. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Guessing you'll want a link to the state document after that is done as well.
I'm a little bit surprised there's no mention of use_callback
for memoizing event handlers here, but guess it's not really the spot for it. Seems strange they're almost completely omitted from the Learn section of the React docs (I'm not seeing them anywhere in there). 🤷
Co-authored-by: margaretkennedy <[email protected]>
https://deephaven.atlassian.net/browse/DOC-346 --------- Co-authored-by: margaretkennedy <[email protected]>
https://deephaven.atlassian.net/browse/DOC-346