Intended outcome:
Just updated my project to [email protected] and got many warnings about deprecation.
So i started on fixing it and one of the features of new React that componentWillReceiveProps gets removed. So this method was replaced by static one - getDerivedStateFromProps which is called both on initial mounting and on re-rendering of the component.
Actual outcome:
After componentWillReceiveProps replace with getDerivedStateFromProps i got error. (Attached)
image uploaded from ios 2
How to reproduce the issue:
Simply upgrade to [email protected] and replace componentWillReceiveProps with getDerivedStateFromProps.
You will get an error
Version
react-native@<0.54.0-rc.4>
react@<16.3.0-alpha.1>
apollo-client@<2.2.2>
I got the same issue as well! Just upgraded to the React 16.3 alpha.
Same.
I'm on [email protected] with [email protected], didn't touch any component life cycle methods just added a graphql query to a component which doesn't use any component life cycle methods and getting this error also.
Also for more info here is the error I get, which causes the app to crash:
Uncaught TypeError: Cannot read property 'currentResult' of undefined
at GraphQL.dataForChild (react-apollo.browser.umd.js:540)
at GraphQL.render (react-apollo.browser.umd.js:590)
at finishClassComponent (react-dom.development.js:7873)
at updateClassComponent (react-dom.development.js:7850)
at beginWork (react-dom.development.js:8225)
at performUnitOfWork (react-dom.development.js:10224)
at workLoop (react-dom.development.js:10288)
at HTMLUnknownElement.callCallback (react-dom.development.js:542)
at Object.invokeGuardedCallbackDev (react-dom.development.js:581)
at invokeGuardedCallback (react-dom.development.js:438)
Update to react-apollo@next it fixes an issue with getDerivedStateFromProps
Closing - housekeeping
Most helpful comment
I'm on [email protected] with [email protected], didn't touch any component life cycle methods just added a graphql query to a component which doesn't use any component life cycle methods and getting this error also.
Also for more info here is the error I get, which causes the app to crash: