-
Notifications
You must be signed in to change notification settings - Fork 47k
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
Calling setState without getInitialState throws when using PureRenderMixin #3316
Calling setState without getInitialState throws when using PureRenderMixin #3316
Comments
Is this with PureRenderMixin? |
Yes, I meant to link to the jsbin: http://jsbin.com/hogike/1/edit?html,js,console,output I'm putting together a PR now. |
It is potentially worth noting that getInitialState is likely to become required for stateful components in the near future. See #3236 (comment) It is already the case that any component calling |
@JSFB I definitely think it makes sense to make |
Without
getInitialState
,this.state
isnull
, which causes this line inshallowEqual
to throw.Fix is to make shallowEqual bail if either argument is falsey (or not an object if we want to be very safe).
The text was updated successfully, but these errors were encountered: