If you use React,
import React from 'react' is the first thing that you write in your code but if you have created a new react app using creat-react-app recently, you might have noticed that there is no import React statement at the top and your code works just fine. So, How's that working?
But, React has introduced a new JSX transform with the release of React 17 which automatically transforms JSX without using
React.createElement. This allows us to not import React, however, you'll need to import React to use Hooks and other exports that React provides. But if you have a simple component, you no longer need to import React. All the JSX conversion is handled by React without you having to import or add anything.
This new JSX transform is also supported in older versions of React so you can start using them even if you don't use React 17.
Read the official React doc to learn more.