-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
Invariant Violation: Minified React error #307 #15010
Comments
Follow these may help you in chasing the error root cause out: https://reactjs.org/warnings/invalid-hook-call-warning.html |
(The final URL that describes possible causes is: https://reactjs.org/warnings/invalid-hook-call-warning.html) |
一般是因为你的项目的react版本,低于使用的第三方库依赖的react的版本造成的,可以将工作项目的react版本升级,或降低依赖库的react版本。 The reason maybe you use multi react version, you should ensure your project code use the react version is more than other library react version. |
i have did as your said, just like . " aside of making React and react-dom peer deependencies in your libraries package.json, you also should mark them as 'externals' when building them with webpack" "peerDependencies": {
"antd": "^3.25.0",
"styled-components": "^4.4.1",
"react": "^16.11.0",
"react-dom": "^16.11.0"
} externals: [
// nodeExternals(),
{
react: {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: 'react-dom',
commonjs: 'react-dom',
amd: 'react-dom'
}
}
} if i don't use useCallback ant useMemo ,it can work,but i need useMemo... |
Should be reopened. This still occur on v16.8.2. |
I am getting below error when try host app with production build, I have used new React Hooks.
Invariant Violation: Minified React error #307; visit https://reactjs.org/docs/error-decoder.html?invariant=307 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
The text was updated successfully, but these errors were encountered: