title: How to import and export styles in react native?
body: <p>I am new to react native.I learned the benefits of components, embedding external styles.Now I am trying to use global styles.I'd like to use the same styles of text, button throughout my app.</p>
  
  <p>Better not to repeat the styles in every component, I'd like to create separate text.js, button.js under styles package to customizing view styles.
  <a href="https://i.stack.imgur.com/jv8jy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jv8jy.png" alt="enter image description here"></a></p>
  
  <p>Here is my project structure.I want to import text.js into my index.js.</p>
  
  <p>index.js</p>
  
  <pre><code>import { AppRegistry } from 'react-native';
  import React, {Component} from 'react';
  import {
    Text
  } from 'react-native';
  import text from './App/styles';
  
  export default class FirstApp extends Component{
      render(){
        return (
          &lt;Text styles={text.p}&gt;Customising React&lt;/Text&gt;
        );
      }
  }
  AppRegistry.registerComponent('FirstApp', () =&gt; FirstApp);
  </code></pre>
  
  <p>text.js</p>
  
  <pre><code>import{
    StyleSheet
  } from 'react-native';
  
  export default const text = StyleSheet.create({
    p: {
      color: 'blue',
      fontSize: 14
    }
  });
  </code></pre>
  
  <p>Is there any way to import my text.js style into text view in index.js?</p>