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
$ npx eslint test.js
/home/adrian/dev/indico/src/test.js
1:1 error This module could be parsed as a valid script import/unambiguous
1:7 error 'Test' is defined but never used no-unused-vars
1:20 error 'React' is not defined no-undef
3:16 error 'state.bar' is missing in props validation react/prop-types
✖ 4 problems (4 errors, 0 warnings)
Disregard the first three errors; I just couldn't be bothered to add the imports etc to the test file - the 4th error is not related to those.
The text was updated successfully, but these errors were encountered:
ThiefMaster
changed the title
Destructuring values from this.state in componentDidUpdate causes prop-types errors
Destructuring values from this.<anything> in componentDidUpdate causes prop-types errors
Oct 16, 2018
Looking at the code this happens in any lifecycle method, regardless of what this. attribute is destructured. I guess the check in isPropTypesUsage is too broad since it doesn't look at the name of the attribute that's destructured in case of a lifecycle method.
Note: This only happens with master, not with the latest stable release.
Example code:
Disregard the first three errors; I just couldn't be bothered to add the imports etc to the test file - the 4th error is not related to those.
The text was updated successfully, but these errors were encountered: