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
Vite (latest version) warn when starting a new project and copying and pasting our demos in the docs:
So there is a DX cost in having those react imports.
Next.js (latest version) doesn't say anything, it's happy with having import * as React from 'react' or not having it.
Summary
See https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports for context. Most of the demos in the docs could be written without the import of React.
This is also reflected in https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md.
Examples
Motivation
In the past, we didn't do the change because there was too many React users <17.0.0. But this seems to mostly OK now:
https://tools-public.mui.com/prod/pages/npmVersion?package=react
Search keywords: optional import react
The text was updated successfully, but these errors were encountered: