We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When shallow rendering a component that has an inner displayName set wrapped in memo and forwardRef the displayName will be inaccurate.
memo
forwardRef
displayName
Discussion in material-ui mui/material-ui#23831
Upstream behavior added in React: facebook/react#18925
So given the following:
const Foo = () => <div />; Foo.displayName = 'CustomWrapper'; const MemoForwardFoo = React.memo(React.forwardRef(Foo)); expect(adapter.displayNameOfNode(<MemoForwardFoo />)).to.equal('Memo(ForwardRef(CustomWrapper))');
Currently : Memo([object object])
Memo([object object])
From the React work, I would expect this to be CustomWrapper, but within Enzyme, it seems more like Memo(ForwardRef(CustomWrapper)) is the expectation
CustomWrapper
Memo(ForwardRef(CustomWrapper))
The text was updated successfully, but these errors were encountered:
Ensure recurrsive calls to displayNameOfNode uses this version of t…
this
a6c671a
…he method fixes enzymejs#2481
75e8963
Successfully merging a pull request may close this issue.
Current behavior
When shallow rendering a component that has an inner displayName set wrapped in
memo
andforwardRef
thedisplayName
will be inaccurate.Discussion in material-ui mui/material-ui#23831
Upstream behavior added in React: facebook/react#18925
So given the following:
Currently :
Memo([object object])
Expected behavior
From the React work, I would expect this to be
CustomWrapper
, but within Enzyme, it seems more likeMemo(ForwardRef(CustomWrapper))
is the expectationYour environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: