Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 661 Bytes

README.md

File metadata and controls

42 lines (37 loc) · 661 Bytes

react-native-roots

<View>
  <App />         <---- original app
  <YourView1 />   <---- your view
  <YourView2 />   <---- your view
  <YourView3 />   <---- your view
  ...
</View>

Installation

npm install react-native-roots --save

Usage

import Roots from 'react-native-roots';

// add root view
Roots.add('loading', (
  <View style={styles.container}>
    <View style={styles.mask}>
      <ActivityIndicator
        animating
        size="small"
        color="#fff"
      />
    </View>
  </View>
));

// remove root view
Roots.remove('loading');

API

add(key, element)

add root view

remove(key)

remove root view