Import style react native

1

Is it possible to import a style from another directory in the import of react native?

I tried something similar to what is done in require to change the directory with "../" but without success.

    
asked by anonymous 02.08.2018 / 15:42

1 answer

1

It can be done like this:

import '../style/style.css'; // ou
import '../style/style.js';

where the two points means to exit the current directory and fall into the root and then enter the path of the other directory and the name of the css.

If you have multiple directories inside one another, you have to exit with .. until you get to src , example if it is 3 directory: ../../../

If you want a hint of editor use Visual Studio Code , it plays the role of completing.

    
02.08.2018 / 16:32