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

Add more info to invalid hook call error message #15139

Merged
merged 4 commits into from Mar 18, 2019

Conversation

jaredpalmer
Copy link
Contributor

@jaredpalmer jaredpalmer commented Mar 18, 2019

This adds more information to the invalid hook call error message summarizing the 3 most common reasons. I am not sure 100% this change is necessary for the server renderer, but included it there as well for completeness.

Related Twitter thread which prompted the change: https://twitter.com/ryanflorence/status/1106809967779012609?s=20

@sizebot
Copy link

sizebot commented Mar 18, 2019

React: size: 0.0%, gzip: -0.0%

ReactDOM: size: 0.0%, gzip: -0.0%

Details of bundled changes.

Comparing: d926936...0f6a8ca

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js +0.3% +0.5% 100.16 KB 100.47 KB 26.04 KB 26.18 KB UMD_DEV
react.production.min.js 0.0% -0.0% 12.34 KB 12.34 KB 4.74 KB 4.74 KB UMD_PROD
react.profiling.min.js 0.0% -0.0% 14.49 KB 14.49 KB 5.26 KB 5.26 KB UMD_PROFILING
react.development.js +0.5% +0.8% 62.7 KB 63.02 KB 16.95 KB 17.08 KB NODE_DEV
react.production.min.js 0.0% -0.1% 6.7 KB 6.7 KB 2.77 KB 2.77 KB NODE_PROD
React-dev.js +0.5% +0.8% 59.76 KB 60.07 KB 15.88 KB 16 KB FB_WWW_DEV
React-prod.js 0.0% -0.0% 15.38 KB 15.38 KB 4.11 KB 4.11 KB FB_WWW_PROD
React-profiling.js 0.0% -0.0% 15.38 KB 15.38 KB 4.11 KB 4.11 KB FB_WWW_PROFILING

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.development.js 0.0% +0.1% 780.58 KB 780.9 KB 178.05 KB 178.17 KB UMD_DEV
react-dom.production.min.js 0.0% -0.0% 105.24 KB 105.24 KB 34.12 KB 34.12 KB UMD_PROD
react-dom.profiling.min.js 0.0% -0.0% 108.24 KB 108.24 KB 34.82 KB 34.82 KB UMD_PROFILING
react-dom.development.js 0.0% +0.1% 774.97 KB 775.29 KB 176.54 KB 176.65 KB NODE_DEV
react-dom.production.min.js 0.0% -0.0% 105.22 KB 105.22 KB 33.66 KB 33.66 KB NODE_PROD
react-dom.profiling.min.js 0.0% -0.0% 108.33 KB 108.33 KB 34.27 KB 34.27 KB NODE_PROFILING
ReactDOM-dev.js 0.0% +0.1% 797.79 KB 798.11 KB 177.66 KB 177.78 KB FB_WWW_DEV
react-dom-unstable-fire.development.js 0.0% +0.1% 780.93 KB 781.24 KB 178.19 KB 178.31 KB UMD_DEV
react-dom-unstable-fire.profiling.min.js 0.0% -0.0% 108.26 KB 108.26 KB 34.83 KB 34.83 KB UMD_PROFILING
react-dom-unstable-fire.development.js 0.0% +0.1% 775.32 KB 775.63 KB 176.68 KB 176.79 KB NODE_DEV
react-dom-unstable-fire.profiling.min.js 0.0% -0.0% 108.35 KB 108.35 KB 34.28 KB 34.28 KB NODE_PROFILING
ReactFire-dev.js 0.0% +0.1% 797 KB 797.32 KB 177.58 KB 177.69 KB FB_WWW_DEV
react-dom-test-utils.development.js 0.0% -0.0% 47.11 KB 47.11 KB 13.01 KB 13.01 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.1% 10.27 KB 10.27 KB 3.8 KB 3.8 KB UMD_PROD
react-dom-test-utils.development.js 0.0% -0.0% 46.83 KB 46.83 KB 12.94 KB 12.94 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.1% 10.05 KB 10.05 KB 3.74 KB 3.73 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.61 KB 60.61 KB 15.92 KB 15.92 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.0% 11.01 KB 11.01 KB 3.81 KB 3.81 KB UMD_PROD
react-dom-unstable-native-dependencies.development.js 0.0% -0.0% 60.28 KB 60.28 KB 15.79 KB 15.79 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% -0.1% 10.75 KB 10.75 KB 3.71 KB 3.71 KB NODE_PROD
react-dom-server.browser.development.js +0.2% +0.3% 130.01 KB 130.32 KB 34.66 KB 34.78 KB UMD_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.19 KB 19.19 KB 7.28 KB 7.28 KB UMD_PROD
react-dom-server.browser.development.js +0.2% +0.3% 126.14 KB 126.45 KB 33.74 KB 33.86 KB NODE_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.12 KB 19.12 KB 7.28 KB 7.28 KB NODE_PROD
ReactDOMServer-dev.js +0.2% +0.4% 127.08 KB 127.4 KB 33.1 KB 33.22 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% -0.0% 45.62 KB 45.62 KB 10.6 KB 10.6 KB FB_WWW_PROD
react-dom-server.node.development.js +0.2% +0.3% 128.2 KB 128.51 KB 34.28 KB 34.4 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.63 KB 3.63 KB 1.44 KB 1.44 KB UMD_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.1% 1.21 KB 1.21 KB 706 B 705 B UMD_PROD
react-dom-unstable-fizz.browser.development.js 0.0% -0.1% 3.45 KB 3.45 KB 1.39 KB 1.39 KB NODE_DEV
react-dom-unstable-fizz.browser.production.min.js 0.0% -0.2% 1.05 KB 1.05 KB 637 B 636 B NODE_PROD
react-dom-unstable-fizz.node.development.js 0.0% -0.1% 3.7 KB 3.7 KB 1.42 KB 1.42 KB NODE_DEV
react-dom-unstable-fizz.node.production.min.js 0.0% -0.3% 1.1 KB 1.1 KB 668 B 666 B NODE_PROD

react-art

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-art.development.js +0.1% +0.1% 552.88 KB 553.2 KB 120.28 KB 120.4 KB UMD_DEV
react-art.production.min.js 0.0% -0.0% 97.06 KB 97.06 KB 29.9 KB 29.9 KB UMD_PROD
react-art.development.js +0.1% +0.1% 483.78 KB 484.09 KB 102.96 KB 103.08 KB NODE_DEV
ReactART-dev.js +0.1% +0.1% 492.71 KB 493.02 KB 102.09 KB 102.21 KB FB_WWW_DEV
ReactART-prod.js 0.0% -0.0% 195.76 KB 195.76 KB 33.3 KB 33.3 KB FB_WWW_PROD

react-native-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
ReactNativeRenderer-dev.js +0.1% +0.1% 618.43 KB 618.79 KB 132.36 KB 132.48 KB RN_FB_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.3% 245.71 KB 246.03 KB 42.95 KB 43.08 KB RN_FB_PROD
ReactNativeRenderer-profiling.js +0.1% +0.3% 251.94 KB 252.25 KB 44.31 KB 44.43 KB RN_FB_PROFILING
ReactNativeRenderer-dev.js +0.1% +0.1% 618.35 KB 618.71 KB 132.33 KB 132.45 KB RN_OSS_DEV
ReactNativeRenderer-prod.js 🔺+0.1% 🔺+0.3% 245.73 KB 246.04 KB 42.95 KB 43.08 KB RN_OSS_PROD
ReactNativeRenderer-profiling.js +0.1% +0.3% 251.96 KB 252.27 KB 44.3 KB 44.43 KB RN_OSS_PROFILING
ReactFabric-dev.js +0.1% +0.1% 608.86 KB 609.22 KB 130.04 KB 130.17 KB RN_FB_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.3% 239.78 KB 240.1 KB 41.75 KB 41.88 KB RN_FB_PROD
ReactFabric-profiling.js +0.1% +0.3% 245.1 KB 245.42 KB 43.12 KB 43.24 KB RN_FB_PROFILING
ReactFabric-dev.js +0.1% +0.1% 608.77 KB 609.13 KB 130 KB 130.12 KB RN_OSS_DEV
ReactFabric-prod.js 🔺+0.1% 🔺+0.3% 239.79 KB 240.1 KB 41.75 KB 41.87 KB RN_OSS_PROD
ReactFabric-profiling.js +0.1% +0.3% 245.11 KB 245.43 KB 43.11 KB 43.24 KB RN_OSS_PROFILING

react-test-renderer

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-test-renderer.development.js +0.1% +0.1% 492.61 KB 492.92 KB 104.58 KB 104.69 KB UMD_DEV
react-test-renderer.production.min.js 0.0% -0.0% 62.99 KB 62.99 KB 19.32 KB 19.32 KB UMD_PROD
react-test-renderer.development.js +0.1% +0.1% 488.13 KB 488.44 KB 103.43 KB 103.55 KB NODE_DEV
react-test-renderer.production.min.js 0.0% -0.0% 62.64 KB 62.64 KB 19.1 KB 19.09 KB NODE_PROD
ReactTestRenderer-dev.js +0.1% +0.1% 498.01 KB 498.32 KB 103.01 KB 103.13 KB FB_WWW_DEV
react-test-renderer-shallow.development.js +0.8% +1.4% 38.51 KB 38.82 KB 9.75 KB 9.89 KB UMD_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.1% 11.73 KB 11.73 KB 3.65 KB 3.65 KB UMD_PROD
react-test-renderer-shallow.development.js +1.0% +1.7% 32.73 KB 33.05 KB 8.35 KB 8.49 KB NODE_DEV
react-test-renderer-shallow.production.min.js 0.0% -0.1% 11.92 KB 11.92 KB 3.77 KB 3.76 KB NODE_PROD
ReactShallowRenderer-dev.js +1.0% +1.9% 31.38 KB 31.7 KB 7.8 KB 7.95 KB FB_WWW_DEV

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.1% +0.1% 482.21 KB 482.52 KB 101.55 KB 101.67 KB NODE_DEV
react-reconciler-persistent.development.js +0.1% +0.1% 480.19 KB 480.51 KB 100.75 KB 100.86 KB NODE_DEV
react-reconciler-reflection.development.js 0.0% -0.0% 15.76 KB 15.76 KB 4.98 KB 4.98 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% -0.1% 2.7 KB 2.7 KB 1.23 KB 1.22 KB NODE_PROD

Generated by 🚫 dangerJS

@gaearon gaearon merged commit 2b93d68 into facebook:master Mar 18, 2019
@gaearon
Copy link
Collaborator

gaearon commented Mar 18, 2019

Looks good, thanks.

gaearon pushed a commit to gaearon/react that referenced this pull request Mar 22, 2019
* Add more info to invalid hook call error message

* Update other renderers + change call to action

* Update related tests for new hooks error message

* Fix lint errors
@gaearon gaearon mentioned this pull request Mar 22, 2019
This was referenced Oct 26, 2019
NMinhNguyen referenced this pull request in enzymejs/react-shallow-renderer Jan 29, 2020
* Add more info to invalid hook call error message

* Update other renderers + change call to action

* Update related tests for new hooks error message

* Fix lint errors
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.

None yet

4 participants