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.state is null #1395
Comments
Use
->
|
oh good point I updated. Although I still have the same issue. even just making the state static won't work this.state = {
isCollapsed: true
}; |
Ah nevermind, I was using a HOC - found discussion in #431 and will export my inner component separately! |
@Jauny you shouldn't need to do that; use |
@ljharb wow awesome thanks a lot! |
I finally found a very good solution to get a wrapper from a decorated component. For shallowed components you can use const wrapper = mount(shallow(<MyComponent />).get(0)) Works like a charm :) |
@dabit1 |
|
Hi, I have state initialized in my component's ES6 class constructor, but during test state is null;
and I get this error
I use
The text was updated successfully, but these errors were encountered: