Skip to content
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

Added Flow type to keep hooks dispatchers in-sync #14599

Merged
merged 2 commits into from
Jan 16, 2019

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jan 15, 2019

Follow up to #14597

@gaearon
Copy link
Collaborator

gaearon commented Jan 15, 2019

Should we also annotate the secret export with them in React package as having this type? And maybe move the definition there.

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 15, 2019

Hm...maybe, although the ref also has the Dispatcher type.

My intended purpose of this new type was to prevent us from forgetting to add hooks to one of these (as I did with the useDebugValue hook). I think the current check covers that. I'm not sure how adding one to the internals file would be able to do the same?

Edit: Although I did notice that my previous added type was a bit redundant and I could have just used the import typeof syntax

@bvaughn
Copy link
Contributor Author

bvaughn commented Jan 15, 2019

How's this now, Dan?

@bvaughn bvaughn merged commit 7ab8a8e into facebook:master Jan 16, 2019
@bvaughn bvaughn deleted the add-Flow-check-for-hooks-APIs branch January 16, 2019 20:49
jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
* Added Flow type to keep hooks dispatchers in-sync
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 2019
* Added Flow type to keep hooks dispatchers in-sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants