Skip to content

Commit 78245b3

Browse files
feat: Don't require default props for function components (#156)
1 parent 99261e2 commit 78245b3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,12 @@ module.exports = {
6565
'react/destructuring-assignment': 'off',
6666
'no-plusplus': 'off',
6767
strict: 'off',
68+
// We don't require 'defaultProps' for function components (they're
69+
// deprecated: https://github.com/facebook/react/pull/16210).
70+
// It's better to use native JavaScript/TypeScript defaults and TS types.
71+
'react/require-default-props': ['error', {
72+
classes: 'defaultProps',
73+
functions: 'ignore',
74+
}],
6875
},
6976
};

0 commit comments

Comments
 (0)