twilio-labs / twilio-style

Twilio's shareable ESLint config

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RFC: Accomodating for React.FC by changing react/require-default-props

espipj opened this issue · comments

Due to new projects involving more and more Functional Components rather than Class Components it seems that the current rule as it is could be slightly outdated as it forces to still use Component.defaultProps even on FC.

Could we change https://github.com/twilio-labs/twilio-style/blob/main/packages/eslint-config-twilio-react/rules/react.js#L74 to:

'react/require-default-props': [
      'error',
      {
        functions: 'defaultArguments',
      },
    ],

References: