React-native-router-flux: Showing Spinner view using react-native-router

Created on 22 Jan 2017  路  5Comments  路  Source: aksonov/react-native-router-flux

Version

Tell us which versions you are using:

  • react-native-router-flux v3.0.0
  • react-native v0.26.0

Expected behaviour

Need to know way to add loader view to each action , we added screen type as modal.
But its not working

Actual behaviour

A modal type of screen shud be seen

Steps to reproduce

  1. Add a screen add type as modal
  2. Do the load
  3. Screen doesnt show up

Most helpful comment

Awwn yeah, I had this error many time so I fix it recently using a component with a DefaultRenderer into a main root like:

MainView.js

import { DefaultRenderer} from 'react-native-router-flux';

...

export default class MainView extends Component {
 ...
  render(){
    const state = this.props.navigationState;
    const children = state.children;
    return (
      <View style={styles.mainContainer}>
        <DefaultRenderer navigationState={children[0]} onNavigate={this.props.onNavigate} />
        <Loading ref="loading"></Loading>
        <MessageBar ref="alert"/>
      </View>
    );
  }
}

Routes.js

 <Router>
        <Scene key="root" component={MainView}>
             //children routes
        </Scene>
</Router>

I hope this will be useful to you. If you have any question only tag me or answer me on twitter @sirgalleto

All 5 comments

Also followed
https://github.com/aksonov/react-native-router-flux/blob/master/docs/OTHER_INFO.md

to show Modals , But its not working .

Please help us to show a spinner view using react-native-router flux

Awwn yeah, I had this error many time so I fix it recently using a component with a DefaultRenderer into a main root like:

MainView.js

import { DefaultRenderer} from 'react-native-router-flux';

...

export default class MainView extends Component {
 ...
  render(){
    const state = this.props.navigationState;
    const children = state.children;
    return (
      <View style={styles.mainContainer}>
        <DefaultRenderer navigationState={children[0]} onNavigate={this.props.onNavigate} />
        <Loading ref="loading"></Loading>
        <MessageBar ref="alert"/>
      </View>
    );
  }
}

Routes.js

 <Router>
        <Scene key="root" component={MainView}>
             //children routes
        </Scene>
</Router>

I hope this will be useful to you. If you have any question only tag me or answer me on twitter @sirgalleto

@sirgalleto this works. Elegant solution. Thanks

YW @sagarparikh

@aksonov I think you should add a default renderer documentation (if is still unexisting).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

booboothefool picture booboothefool  路  3Comments

sreejithr picture sreejithr  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments

GCour picture GCour  路  3Comments

moaxaca picture moaxaca  路  3Comments