-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Hooks are not working with webpack dll plugin #15447
Comments
why you not show your code in this issue? |
@leeseean no problem:
Such basic hook doesn't work when exposed via webpack dll plugin.
|
Only Call Hooks at the Top Level Only Call Hooks from React Functions ✅ Call Hooks from React function components. |
@leeseean I am doing the same. |
cc @mui-org Please be informed that the issue definitely exists. You can use the example project of Material UI to reproduce the issue. If you add following packages as part of your DLL for development, then these two packages would stop working as React Hooks are broken when prebundled:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
Not stale. The issue could save tremendous bundling time as mostly 80% of a typical list of dependencies on the frontend of a react developer are related to this issue. Since hooks break on prebundling, the developers have to avoid prebundling on react related dependencies. Please be clear, if you plan to support it. |
is there any activity, news on this issue? this implies it works out of the box: |
Came here from an issue in material-ui. |
any updates on this? |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
It compiles, but doesn't work.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
I created a repo with simple example and description of the problem:
https://github.com/yevhey/hooks-problem
What is the expected behavior?
It compiles the code and works as usual with webpack.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React/React dom – 16.8.6
browser – chrome 73
os – MacOS Mojave 10.14.4
in React 16.8.0 doesn't work as well.
The text was updated successfully, but these errors were encountered: