Skip to content

Cannot find a function component wrapped with React.memo HOC #2038

@papiro

Description

@papiro

Current behavior

When trying to .find a memoized function component within a mounted tree and .debug it, returns an empty string.
This is regarding the new React.memo feature. When I simply remove the React.memo wrapper from the component, then it is found and its contents printed to the console on .debug. With the wrapper, it appears the component cannot be found.

Expected behavior

Should output the component.

Your environment

Windows 10, GitBash, Jest

API

  • [x ] mount

Version

library version
enzyme 3.9.0
react 16.8.3
react-dom 16.8
react-test-renderer 16.8.4
adapter (below) 1.10.0

Adapter

  • [x ] enzyme-adapter-react-16

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions