I’ve written before about the two competing ways to import React, but after React 17, you don’t need either.

React used to be mostly imported as a default:

import React from 'react';

Then, we were advised by core team members to drop the default because it was going to be deprecated:

import * as React from 'react';

I’m late to the party learning that with the JSX transform introduced in React 17, you don’t need to import React at all to use JSX. You only need to import other functions you might use.

import { useState } from 'react';

The best code is no code!