From 988fefc44d39957e8c5e1eecb02dfd1ce119f34c Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Wed, 26 Jan 2022 03:31:04 -0800 Subject: [PATCH] Enable react/no-unstable-nested-components rule Summary: Dynamic nested components can cause tricky performance issues in React, as the reconciler will not be able to reuse the previously mounted component tree. Changelog: [General] [Added] Added linter warning config for unstable nested components Reviewed By: motiz88 Differential Revision: D33767283 fbshipit-source-id: 869ece99dc63cc3a150bae882d26df8541e8db59 --- packages/eslint-config-react-native-community/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/eslint-config-react-native-community/index.js b/packages/eslint-config-react-native-community/index.js index bb8936f9d1df3e..34759731a5b2ee 100644 --- a/packages/eslint-config-react-native-community/index.js +++ b/packages/eslint-config-react-native-community/index.js @@ -300,6 +300,7 @@ module.exports = { 'react/no-multi-comp': 0, 'react/no-string-refs': 1, 'react/no-unknown-property': 0, + 'react/no-unstable-nested-components': 1, 'react/prop-types': 0, 'react/react-in-jsx-scope': 1, 'react/self-closing-comp': 1, @@ -307,8 +308,8 @@ module.exports = { // React-Hooks Plugin // The following rules are made available via `eslint-plugin-react-hooks` - 'react-hooks/rules-of-hooks': 'error', - 'react-hooks/exhaustive-deps': 'error', + 'react-hooks/rules-of-hooks': 2, + 'react-hooks/exhaustive-deps': 2, // React-Native Plugin // The following rules are made available via `eslint-plugin-react-native`