You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey guys, I'm trying to use the .context method from the Full DOM rendering API in a stateless component and I'm getting the following error:
- Error: You cannot get an instance of a stateless component.
at getInstance (node_modules/enzyme/build/ReactWrapperComponent.js:81:17)
at ReactWrapper.instance (node_modules/enzyme/build/ReactWrapper.js:143:31)
at ReactWrapper.<anonymous> (node_modules/enzyme/build/ReactWrapper.js:601:25)
at ReactWrapper.single (node_modules/enzyme/build/ReactWrapper.js:1066:19)
at ReactWrapper.context (node_modules/enzyme/build/ReactWrapper.js:600:29)
at Spec.<anonymous> (src/shared/components/fieldset/__tests__/fields.js:155:27)
I copied the code from enzyme tests, and updated it to support context:
Basically I'm trying to pass a context for my stateless component, if I don't run wrapper.context('_') than no errors are thrown. But when I use it then the error occurs.
I don't know if that's the expected behaviour, or if that's happening with othre methods as well.
Cheers
The text was updated successfully, but these errors were encountered:
Hmm. I wonder what the right way to get at context for SFCs are.
There might be a couple of other methods that call .instance() that don't have to and are failing with SFCs as well. We should increase our coverage for SFCs.
Hey guys, I'm trying to use the
.context
method from the Full DOM rendering API in a stateless component and I'm getting the following error:I copied the code from
enzyme
tests, and updated it to support context:Basically I'm trying to pass a context for my stateless component, if I don't run
wrapper.context('_')
than no errors are thrown. But when I use it then the error occurs.I don't know if that's the expected behaviour, or if that's happening with othre methods as well.
Cheers
The text was updated successfully, but these errors were encountered: