Skip to content

Commit 44dbd0b

Browse files
committed
[eslint config] [patch] disable no-did-mount-set-state, since it’s necessary for server-rendering.
Fixes #684.
1 parent 5682155 commit 44dbd0b

File tree

1 file changed

+2
-1
lines changed
  • packages/eslint-config-airbnb/rules

1 file changed

+2
-1
lines changed

packages/eslint-config-airbnb/rules/react.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ module.exports = {
142142

143143
// Prevent usage of setState in componentDidMount
144144
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-mount-set-state.md
145-
'react/no-did-mount-set-state': 'error',
145+
// this is necessary for server-rendering
146+
'react/no-did-mount-set-state': 'off',
146147

147148
// Prevent usage of setState in componentDidUpdate
148149
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-did-update-set-state.md

0 commit comments

Comments
 (0)