-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Snapshots should not contain internal React instances #1429
Snapshots should not contain internal React instances #1429
Comments
I'm assuming you didn't call |
I don’t know, how can I check? I just updated React in www and existing snapshot tests failed because they encoded React internal objects. |
How do you think we should print these? Just like any other React component using |
To be clear, element itself is fine. It's just that |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry if this is the wrong place to file it.
I changed something internal in React and saw snapshot change on www:
These are React internal instances. Oops! How did this happen?
An object passed as a prop contained a reference to React element. That element contained
_owner
field pointing to an internal React instance. That React instance contains references to all its children recursively.We should find a way to exclude any React internal instances.
A reasonable heuristic these days may be to exclude any object that has
_currentElement
property.The text was updated successfully, but these errors were encountered: