There is no difference. There in no performance difference or functionality difference. In fact they both reference the same exact function.
import React, { useEffect } from 'react'
React.useEffect === useEffect // true
So which to use is entirely down to your preferences.
Some people like to have an namespace for React stuff so you can type React.use and have your IDE's autocomplete give you nice suggestions.
Some people like to keep line length shorter by importing the functions directly.
It's up to you. Neither is obviously wrong.
One thing that maybe matters is that a smart bundler may be able to tree shake things you aren't using, which makes the code you are shipping to the user smaller.
If you do import React from 'react'; React.useState() then the bundler must include the entire React object. But if you import { useState } from 'react', then the bundle may be able to include only the useState function in the final bundle.
I say may because bundling is complicated. And not all modules that you import may be tree shaken in this way. And for React, you probably are including all of React in your bundle anyway.
But for these reasons, I'd argue it's a reasonable habit to get into when the module you are importing supports it.
And for what it's worth, the react docs import each function individually.

Tried explaining how React 19 reduces useEffect usage — would appreciate feedback
reactjs - Is there a difference between: e.g. useEffect() & React.useEffect() - Stack Overflow
reactjs - With introduction of React 19, how would you implement a refetch on some value change - Stack Overflow
Goodbye, useEffect - Reactathon 2022
Videos
I’ve been trying to understand how React 19 changes async logic, especially around reducing the need for useEffect in data fetching and form actions.
I put together a short 9-minute explanation covering use(), Server Actions, useOptimistic and useFormStatus, mainly focusing on how they simplify common async patterns.
Would really appreciate any feedback on whether the explanation makes sense or if I’ve misunderstood anything.
Video link: https://youtu.be/H8RTMU5tVmU
There is no difference. There in no performance difference or functionality difference. In fact they both reference the same exact function.
import React, { useEffect } from 'react'
React.useEffect === useEffect // true
So which to use is entirely down to your preferences.
Some people like to have an namespace for React stuff so you can type React.use and have your IDE's autocomplete give you nice suggestions.
Some people like to keep line length shorter by importing the functions directly.
It's up to you. Neither is obviously wrong.
One thing that maybe matters is that a smart bundler may be able to tree shake things you aren't using, which makes the code you are shipping to the user smaller.
If you do import React from 'react'; React.useState() then the bundler must include the entire React object. But if you import { useState } from 'react', then the bundle may be able to include only the useState function in the final bundle.
I say may because bundling is complicated. And not all modules that you import may be tree shaken in this way. And for React, you probably are including all of React in your bundle anyway.
But for these reasons, I'd argue it's a reasonable habit to get into when the module you are importing supports it.
And for what it's worth, the react docs import each function individually.

Question is not specific to react, but any ES module where we can either destructure imports or use dot notation.
Might be a slightly better to extract the property once instead of reading it from the object.
Also, the fact that the minified bundle will include something of the form r.u instead of u if we plan on not destructing.

Here is the babel playground
I was reading up on the React 19 changes and one of them is the use keyword.
On the React docs, it says:
When a context is passed to
use, it works similarly touseContext[...]useis preferred over useContext because it is more flexible
From what I understand, use is just useContext but you have the flexibility to call it conditionally and in code blocks.
Which is why I'm confused. Why didn't the developers just change useContext's functionality instead of creating a new hook if they work similarly? If use just adds features, it doesn't break any compatibility, right?
Please let me know if I am missing something.