Skip to content

Snapshots should not contain internal React instances #1429

Closed
jamiebuilds/pretty-format
#29
@gaearon

Description

@gaearon

Sorry if this is the wrong place to file it.
I changed something internal in React and saw snapshot change on www:

screen shot 2016-08-15 at 16 19 08

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions