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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

React.memo with snapshot testing results in <UNDEFINED> when upgrading to React 16.12.0 #9216

Closed
danplubell opened this issue Nov 21, 2019 · 3 comments

Comments

@danplubell
Copy link

馃悰 Bug Report

After uplifting to React 16.12.0 all of my jest tests that do a shallow rendering and user snapshots started to fail because the name of the component is now rendered as if the component is a memo component.

An example is a component that with React 16.11 rendered in the snapshot like this:
<Memo(Connect(InjectIntl(OptimizerFooter))) />

After uplifting to v16.12 it renders like this:

These components are using React-Redux v7.1.1

To Reproduce

  • Create a component that uses React-Redux.connect
  • Create a test that does a shallow rendering of the component
  • Use toMatchSnapshot

Steps to reproduce the behavior:

Expected behavior

Ideally a Memo component would render as it did prior to React 16.12

Link to repl or repo (highly encouraged)

envinfo

System:
OS: macOS Mojave 10.14.6
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 8.9.2 - ~/.nvm/versions/node/v8.9.2/bin/node
npm: 6.12.1 - ~/.nvm/versions/node/v8.9.2/bin/npm
npmPackages:
jest: ^24.8.0 => 24.9.0

@thymikee
Copy link
Collaborator

The fix is on master and will be released with v25: #9196

@mstoltenburg
Copy link

Is there a scheduled release date for v25?

@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants