-
-
Notifications
You must be signed in to change notification settings - Fork 856
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
Cannot perform get on revoked proxy error when no recursion #117
Comments
@TrueWill I fixed the issue that the result set was not properly finalized. However, I am pretty sure that this reducer is not doing what you intend it to do; you return a sub part of the original state, effectively changing its shape. Your reducer now transforms the state: {
availableStartingDots: [
{ dots: 4, count: 1 },
{ dots: 3, count: 2 },
{ dots: 2, count: 3 },
{ dots: 1, count: 4 }
]
} into [
{ dots: 4, count: 1 },
{ dots: 3, count: 2 },
{ dots: 2, count: 3 },
{ dots: 1, count: 4 }
] What you probably want is:
|
Released as 1.1.3. Thanks for reporting! |
@mweststrate Yep - I changed the shape to keep the example as simple as possible. The original code preserves shape. Thank you! 😃 |
Just tested it - works fine! Great job! |
Similar to #100, I'm getting
TypeError: Cannot perform 'get' on a proxy that has been revoked
from a test after converting a reducer to immer.
I narrowed the code down from the original to a minimal example, which is why it looks odd.
The above reducer will raise the error when given this state and the SET_STARTING_DOTS action:
Changing the case to
return state.availableStartingDots.map(a => a);
removes the error.The text was updated successfully, but these errors were encountered: