Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fresh] Generate signatures for Hooks (facebook#15733)
* Generate signatures for Hooks This currently only works one level deep. For custom Hooks, we'll need to add some way to compose signatures. * Be more resilient to plugin conflicts This prevents a class of problems where other plugins cause our visitor to re-run. It's a standard Babel practice, e.g.: https://github.com/babel/babel/blob/8c7d4b55c99ff34cb9d493d452472e59b5ed1e70/packages/babel-plugin-transform-react-constant-elements/src/index.js#L85-L86 * Remove unnecessary stuff from debugging * Include Foo.useHookName() calls into the signature * Add an integration test for adding/removing an effect * Add integration test for changing custom Hook order * Include custom Hooks into the signatures * Fix inferred names for function expressions * Support export default hoc(Foo) when Foo is defined separately * Add more built-in Hooks
- Loading branch information