Globally importing ReactJS components in all files
In React when you wanna import components from other files we use:
import ComponentName from 'somePlace';
That works fine, but I wanna know if there is a way to import the content of a file instead of the exports. I wanna put all import statements for components in a single file (e.g. imports.js) and have a statement like:
import './import.js' to all documents;
so all my components are automatically imported everywhere.
Is there a way to do that?
from Recent Questions - Stack Overflow https://ift.tt/3zB14zG
https://ift.tt/eA8V8J
Comments
Post a Comment