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
We should always put constructor method at the very beginning of the class, but in this way, eslint will complain: constructor must be placed after render. If I place the "constructor" in the order options to adjust the rule, eslint will throw error:
/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint-plugin-react/lib/rules/sort-comp.js:105
isRegExp = methodsOrder[i].match(regExpRegExp);
^
TypeError: Object function Object() { [native code] } has no method 'match'
at getRefPropIndexes (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint-plugin-react/lib/rules/sort-comp.js:105:34)
at comparePropsOrder (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint-plugin-react/lib/rules/sort-comp.js:258:23)
at checkPropsOrder (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint-plugin-react/lib/rules/sort-comp.js:322:17)
at EventEmitter.Program:exit (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint-plugin-react/lib/rules/sort-comp.js:351:9)
at EventEmitter.emit (events.js:117:20)
at Controller.controller.traverse.leave (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint/lib/eslint.js:733:25)
at Controller.__execute (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:393:31)
at Controller.traverse (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint/node_modules/estraverse/estraverse.js:481:28)
at EventEmitter.module.exports.api.verify (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint/lib/eslint.js:718:24)
at processFile (/Users/tangrui/.nvm/v0.10.36/lib/node_modules/eslint/lib/cli-engine.js:197:27)
The text was updated successfully, but these errors were encountered:
The new React 0.13.x introduces ES6 features, which allows to write ES6 classes.
We should always put constructor method at the very beginning of the class, but in this way, eslint will complain: constructor must be placed after render. If I place the "constructor" in the order options to adjust the rule, eslint will throw error:
The text was updated successfully, but these errors were encountered: