External stylesheets in react native

reactinterviewquestions

In todays tutorial we are going to learn how to include external stylesheets in react native.Although this goes against the basic principles of react native sometimes it becomes imperative to reuse stylesheets for certain views in react native.
The steps are as follows:
Create a separate file for stylesheets(style.js) with following syntax:

2)Import the stylesheet into required js file as:
import styles from './style';

3)Use styles properties anywhere in your views as:

Thats it for todays short tutorial.
We will cover more advanced topics in react native in upcoming ones.

Share post-
About Saurabh Mhatre 70 Articles
Currently working in web and hybrid application development