Skip to content

Commit 667e592

Browse files
author
Keyan Zhang
committed
fixed how we identify shadowing issues
1 parent f00fbb0 commit 667e592

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

transforms/class.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,11 @@ module.exports = (file, api, options) => {
253253
};
254254

255255
const isInitialStateConvertible = classPath => {
256-
const result = isGetInitialStateConstructorSafe(
257-
ReactUtils.getReactCreateClassSpec(classPath)
258-
);
256+
const specPath = ReactUtils.getReactCreateClassSpec(classPath);
257+
if (!specPath) {
258+
return false;
259+
}
260+
const result = isGetInitialStateConstructorSafe(findGetInitialState(specPath));
259261
if (!result) {
260262
console.warn(
261263
file.path + ': `' + ReactUtils.getComponentName(classPath) + '` ' +

0 commit comments

Comments
 (0)