-
Notifications
You must be signed in to change notification settings - Fork 801
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
Reconciliation fails when using lodash/memoize #984
Comments
Please provide code to reproduce. As far I know - you can not get some modules updated, but reconcilation should not fail. |
If I move all the memoized methods to another file this seems to work alright. I’m gonna try to create a simple setup that reproduces the problem. |
fixed in v4.3.0 |
I cannot confirm this is fixed. Sorry I haven’t had time to create the test setup yet. |
🤷♂️😭 |
#995 (comment) 🤷♂️ |
I think I might have found what is wrong on my end though I don’t understand it completely 🙈 First, my comment above is wrong. I looked more into this and now I see that with What I believe is the issue on my end is the memoized function is being used as a prop to a child component which had the changed component lower in the tree. So it seems the child component was still getting the same function passed as prop after the hot reload which then effectively stopped the re-rendering since it was a pure component. Perhaps there is something else in play here as I have not been able to reproduce this in a simple app created from |
I am undestanding what you are talking about. Currently hot loader could not bypass any memoization, as long it's goal is to preserve values. Currently you can chose what you want to get - component not updated, or state loss. Probably, in your case, state loss is preferred. Use new |
Description
Hot reloading fails for files using
lodash/memoize
in4.2.0
Removing all calls to the
memoize
function fixes the issue for that file.It doesn’t make sense that this problem has anything to do with the
memoize
function itself but it happens to be the problematic function in this case.It was only being used at the top level of the file.
Expected behavior
Should hot reload the file.
Actual behavior
Hits an error:
reconcilation failed due to error ReferenceError: resolver is not defined
resolver
is the second argument passed tomemoize
Environment
React Hot Loader version:
4.2.0
Run these commands in the project folder and fill in their results:
node -v
:9.5.0
npm -v
:5.6.0
yarn -v
:1.6.0
Then, specify:
MacOS 10.13.4
Chrome 66.0.3359.170
Reproducible Demo
N/A
The text was updated successfully, but these errors were encountered: