Answer the question
In order to leave comments, you need to log in
What is the best way to import react?
What is the best way to import react? Through * or prescribe the components used?
If you import via *, then when you build the project, does the react import only the used components or all?
Answer the question
In order to leave comments, you need to log in
There is an article about this on Habré
In the general case, as you prefer, import it.
Afraid of getting confused or losing the connection (there are packages with similar components in libraries), then import via *
If you are sure that there will be no other libraries, then import only certain components
In any of the cases, React imports only the components that are needed here and now.
Addendum:
Optimization will suffer, and here it will depend on the number of imported components. Information is here about optimization , and general information is here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question