Eslint-plugin-react: react/sort-comp strange behaviour

Created on 23 Apr 2019  路  4Comments  路  Source: yannickcr/eslint-plugin-react

I receive the following react/sort-comp error

UNSAFE_componentWillReceiveProps should be placed after setAgreementStatusFormValue

where setAgreementStatusFormValue is not static method

According to description here

the order should be like this

  order: [
    'static-methods',
    'lifecycle',
    'everything-else',
    'render'
  ],

my method setAgreementStatusFormValue is under group 'everything-else'

bug help wanted

Most helpful comment

@ljharb React version 16.8.6

All 4 comments

UNSAFE_componentWillReceiveProps isn't a static method either, it's a lifecycle method.

What version of React are you using? Have you specified that in your eslintrc?

@ljharb we specify react: { version: 'detect' } in our eslint config because we share it between projects on different version of React

ok, and which version of react is being used on this project?

@ljharb React version 16.8.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

otakustay picture otakustay  路  3Comments

mydearxym picture mydearxym  路  3Comments

AaronHarris picture AaronHarris  路  3Comments

gpeal picture gpeal  路  3Comments

budarin picture budarin  路  3Comments