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

isShallow: false can result in proxies getting wrapped with proxies #69

Closed
ChuckFields opened this issue Dec 16, 2020 · 1 comment
Closed
Assignees
Labels

Comments

@ChuckFields
Copy link

ChuckFields commented Dec 16, 2020

I've been experiencing an issue when using onChange with isShallow: false. In my code I end up doing something like this obj1 === obj2 which will return false, however when I look closely they are the same object under the hood, it's just that one of them is wrapped in an additional proxy. I was able to reproduce this issue in a codesandbox here. You'll need to open your browser console, as the built in console does not show the proxies.

From what I've gathered, when getProxy() in cache.js gets called, the target is already a proxy and will end up getting wrapped in another proxy. There may be other ways to end up in this scenario other than what I've provided, but, I think a solid solution would prevent this from ever happening again.

Edit: here is more simple example of this problem happening

@DarrenPaulWright
Copy link
Collaborator

This should be fixed in v2.2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants