Answer the question
In order to leave comments, you need to log in
React no longer needs to include it?
I’m watching a 2020 course on React and there, when a person was making one of the components, he got an error and had to write:
import React from 'react';
But at the same time, when I didn’t write it, everything worked.
As I understand it, there was an update and the need to add was removed? Or is it still better to prescribe in the code just in case:
import React from 'react';
Answer the question
In order to leave comments, you need to log in
if some hooks are not used, for example useState
, or useEffect
then you can not connect
Most likely you have React loaded on an HTML page (as in the picture below), in which case you do not need to import it as a module.
Another way to connect is to install the react library via npm and import it in code.
Everything is written about this in the React docks, I advise you to watch them, and not videos, especially since there is a Russian language there.
import React from 'react';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question