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

budarin picture budarin  路  3Comments

otakustay picture otakustay  路  3Comments

strawbrary picture strawbrary  路  3Comments

BrodaNoel picture BrodaNoel  路  3Comments

mericsson picture mericsson  路  3Comments