-
Notifications
You must be signed in to change notification settings - Fork 64
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
Component created using React.memo appears as "Component" in snapshot #137
Comments
This is well known issue with babel react preset. Put React.memo() on separate line like:
|
This has now become an issue when using Redux 7.x, which uses
|
Yeah, we faced the same issue. It will be super perfect if it is possible to fix and display component name instead of |
Same issue for us too. Got around it with: import React, { memo } from 'react';
const Tile = props => { ... };
export default memo(Tile); |
It's maybe possible to make a PR with this comment: PR are welcomed |
Hello everyone, I've created an open issue on jest's official repo but apparently it looks to be a bug on this library instead so I'll leave it here.
Can you guys please take a look?
Thank you.
jestjs/jest#8122
🐛 Bug Report
To Reproduce
A clear and concise description of what the bug is.
Hello,
When, I have the following components:
And test
App.jsx
with the following:I get the following snapshot:
Expected behavior
As you can see, where I was expecting something like
memo(MainMenu)
, I'm getting<Component />
.What's worse is, that if I replace the render in App to, instead of using
<MainMenu />
, to use another memoized component, the snapshot will still pass because it won't notice the difference.Run
npx envinfo --preset jest
Paste the results here:
Reproducible repo:
https://github.com/Powerade/jest-react-memo-bug
The text was updated successfully, but these errors were encountered: