Hi devs!
The last days I was looking into some react repos because I want to implement a component library on my own. And I realized that many people now are using React functionalities via React object.
import * as React from 'react'
/*functional component declaration*/
const [count, setCount] = React.useState(0)
React.useEffect(() => {
//some logic here
}, [])
What is the porpoise of this? What about just importing directly what you need?
Top comments (1)
The official documentation import that with way you want
react.dev/reference/react/useState