You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[New] react-in-jsx-scope, jsx-uses-react: automatically disable when React >= 19 is detected
React 19 mandates the automatic JSX transform, so `React` no longer
needs to be in scope for JSX. This makes the `react-in-jsx-scope` and
`jsx-uses-react` rules no-ops when the configured React version is
>= 19.0.0, following the same `return {}` early-exit pattern used by
`no-unsafe`.
Signed-off-by: Jon Koops <jonkoops@gmail.com>
Copy file name to clipboardExpand all lines: docs/rules/jsx-uses-react.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,3 +52,5 @@ var Hello = <div>Hello {this.props.name}</div>;
52
52
If you are not using JSX, if React is declared as global variable, or if you do not use the `no-unused-vars` rule.
53
53
54
54
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/index.js#L163-L176) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
55
+
56
+
**Note**: When React >= 19.0.0 is detected, this rule is automatically disabled, since the automatic JSX transform is mandatory in React 19.
Copy file name to clipboardExpand all lines: docs/rules/react-in-jsx-scope.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,3 +51,5 @@ var Hello = <div>Hello {this.props.name}</div>;
51
51
If you are not using JSX, or if you are setting `React` as a global variable.
52
52
53
53
If you are using the [new JSX transform from React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports), you should disable this rule by extending [`react/jsx-runtime`](https://github.com/jsx-eslint/eslint-plugin-react/blob/8cf47a8ac2242ee00ea36eac4b6ae51956ba4411/index.js#L165-L179) in your eslint config (add `"plugin:react/jsx-runtime"` to `"extends"`).
54
+
55
+
**Note**: When React >= 19.0.0 is detected, this rule is automatically disabled, since the automatic JSX transform is mandatory in React 19.
0 commit comments