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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShallowWrapper instance() method always returns null since 1.15.3 #2434

Closed
cascornelissen opened this issue Aug 13, 2020 · 11 comments · Fixed by #2443
Closed

ShallowWrapper instance() method always returns null since 1.15.3 #2434

cascornelissen opened this issue Aug 13, 2020 · 11 comments · Fixed by #2443

Comments

@cascornelissen
Copy link

Looks like this change broke the .instance() method on a shallow() rendered component for us when the root component is a React.Suspense. Verified to be working correctly in [email protected].

const wrapper = shallow(<ClassComponentWithReactSuspense />);
wrapper.instance(); // Always null

Any ideas?


It does seem to work correctly when using mount() though.

Originally posted by @cascornelissen in #2328 (comment)

@joshuablokland
Copy link

I have the same issue as well!

@fataltrace
Copy link

I have the same problem, too.

@cascornelissen
Copy link
Author

Tagging @ljharb and @lamhieu-vk to make sure they're aware multiple people are running into this.

@lh0x00
Copy link
Contributor

lh0x00 commented Aug 27, 2020

Sorry for the late reply. I will debug, report, and fix it soon!

@cascornelissen
Copy link
Author

@lamhieu-vk, I had a notification about a reply on this thread asking for repro repo but since that message is not visible here I guess you’ve found the issue and don’t need a repro anymore?

@lh0x00
Copy link
Contributor

lh0x00 commented Aug 28, 2020

@cascornelissen I created repro repo for this bug

@lh0x00
Copy link
Contributor

lh0x00 commented Aug 28, 2020

I created a pull request for this issue!

@cascornelissen
Copy link
Author

@ljharb, sorry to tag you but are there any plans for a new patch release? We'd really like to get this fixed in our projects. 😅

Also, thanks for your time working on OSS! ❤️

@ljharb
Copy link
Member

ljharb commented Aug 31, 2020

v1.15.4 is released.

@lh0x00
Copy link
Contributor

lh0x00 commented Aug 31, 2020

@cascornelissen please verify the new version and confirm here 😉

@cascornelissen
Copy link
Author

Thanks for the release, it does indeed fix it on our projects. Thanks to both of you once more!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants