Advertisement
Guest User

Example ActivityIndicator

a guest
May 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react'
  2. import {
  3.   View,
  4.   ActivityIndicator,
  5.   Button,
  6. } from 'react-native'
  7.  
  8. export class App extends Component {
  9.   state = { loading: false }
  10.  
  11.   activate = () => this.setState({ loading: true })
  12.  
  13.   render() {
  14.     const { loading } = this.state
  15.  
  16.     return (
  17.       <View>
  18.         <ActivityIndicator
  19.           size='large'
  20.           color='#ff0000'
  21.           animating={loading}
  22.         />
  23.         <Button
  24.           title='Click me'
  25.           onPress={this.activate}
  26.         />
  27.       </View>
  28.     )
  29.   }
  30. }
  31.  
  32. export default App
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement