DEV Community

Discussion on: You no longer need to import React from 'react'

Collapse
 
titungdup profile image
dhondup • Edited

I'm very positive Babel is the reason.

Thread Thread
 
antonofthewoods profile image
Anton Melser • Edited

Not just babel. You can use it with vite (with TS, for example). reactjs.org/blog/2020/09/22/introd...

"We’d like to thank Babel, TypeScript, Create React App, Next.js, Gatsby, ESLint, and Flow maintainers for their help implementing and integrating the new JSX transform. "

If you are getting an eslint error on one of the other platforms (like TS), you can just (from github.com/jsx-eslint/eslint-plugi...

If you are using the new JSX transform from React 17, you should disable this rule by extending react/jsx-runtime in your eslint config (add "plugin:react/jsx-runtime" to "extends").