Skip to content

Add setState example to Basic Prop Types #575

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

Merged

Conversation

WillowP
Copy link
Contributor

@WillowP WillowP commented Oct 12, 2022

Solves #574

Copy link
Collaborator

@swyxio swyxio left a comment

Choose a reason for hiding this comment

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

1 suggesiton but lgtm, letting @filiptammergard review

Co-authored-by: swyx <shawnthe1@gmail.com>
Copy link
Collaborator

@filiptammergard filiptammergard left a comment

Choose a reason for hiding this comment

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

Sweet! Small suggestion, let's change to that and we're ready to merge!

@filiptammergard
Copy link
Collaborator

@WillowP Last thing, can you run yarn gen-readme and push the diff?

@WillowP
Copy link
Contributor Author

WillowP commented Oct 14, 2022

Sweet! Small suggestion, let's change to that and we're ready to merge!

On second thought, I wonder if taking out the reference to useState in the comment might be a bad idea. Technically there are different kinds of state setting functions (ie the dispatch returned by useReducer), but this is specifically for the one returned by useState. Readers might be confused if we just call it "the state setter function".

What about:

the state setter function returned by `useState`

@filiptammergard
Copy link
Collaborator

Sweet! Small suggestion, let's change to that and we're ready to merge!

On second thought, I wonder if taking out the reference to useState in the comment might be a bad idea. Technically there are different kinds of state setting functions (ie the dispatch returned by useReducer), but this is specifically for the one returned by useState. Readers might be confused if we just call it "the state setter function".

What about:

the state setter function returned by `useState`

Good point, yes let's go for that tweak!

@filiptammergard
Copy link
Collaborator

Thanks @WillowP!

@filiptammergard filiptammergard merged commit 3187b53 into typescript-cheatsheets:main Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Basic] Add example of passing a setState dispatch action to basic prop types
3 participants