1
You can import a style from another directory in the React import?
I tried something similar to what is done in require to change the directory with ".. /" but to no avail.
1
You can import a style from another directory in the React import?
I tried something similar to what is done in require to change the directory with ".. /" but to no avail.
1
It can be done like this:
import '../style/style.css'; // ou
import '../style/style.js';
where the two dots means exit the current directory and fall at the root and then type the path of the other directory and the name of css.
If you have multiple directories inside each other, you have to leave with ..
until you reach the src
, example if it is 3 directory: ../../../
If you want an editor tip use Visual Studio Code, he plays the part of completing.
Browser other questions tagged react-native import style
You are not signed in. Login or sign up in order to post.
where the directory is, it’s inside the
src
?– novic
That, I have inside src, a component folder and another Styles, I can apply a style of Styles inside the components or it is better to leave the style.js inside the components folder?
– Bruno Barros
It worked out Bruno?
– novic
Opa gave yes thanks.
– Bruno Barros