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
TypeError: Cannot read property 'map' of undefined
at inlineGetInitialState (class.js:294:12)
at createConstructor (class.js:343:15)
at createESClass (class.js:362:11)
at updateToClass (class.js:477:7)
at NodePath.<anonymous> (class.js:507:31)
at __paths.forEach (/Users/ricard.sole/.nvm/versions/node/v6.2.2/lib/node_modules/jscodeshift/dist/Collection.js:71:36)
at Array.forEach (native)
at Collection.forEach (/Users/ricard.sole/.nvm/versions/node/v6.2.2/lib/node_modules/jscodeshift/dist/Collection.js:70:18)
at apply (class.js:507:10)
at module.exports (class.js:514:7)
The text was updated successfully, but these errors were encountered:
Thanks @reergymerej and @rcsole. Please notice that the class codemod will be replaced by #54 (comment) soon.
As @reergymerej mentioned, most of the codemods in this repo are used by Facebook internally -- we try to support the community's needs as much as possible but unfortunately we won't be able to cover every edge case. Internally at Facebook we don't have code like this; given that the level of robustness required for codemods (they are used internally across our entire front end code base), I guess we won't take a PR unless it has been intensively battle-tested. Thanks!
Hi!
So I ran into an issue where running the mod when
getInitialState
is an arrowfunction it breaks (code has been changed due to corporate IP...):
The error message would be this:
The text was updated successfully, but these errors were encountered: