question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

router-flux-blank-screen showing where initial screen should be

See original GitHub issue

Version

Tell us which versions you are using:

  • react-native-router-flux v4.?.? (v3 is not supported)
  • react-native v0.54RC

Expected behaviour

Want to display initial screen defined in Routes.js

Actual behaviour

Showing only blank screen with container style inside and top bar colored to green. Routes.js


import React, {Component} from 'react';

import {Router, Stack, Scene} from 'react-native-router-flux';

import Login from './pages/Login';
import SignUp from './pages/SignUp';

export default class Routes extends Component<{}> {
    render() {
        return (
            <Router>
                <Stack key="root" hideNavBar={true}>
                    <Scene key="login" component={Login} title="Přihlášení" initial={true}/>
                    <Scene key="register" component={SignUp} title="Registrace"/>
                </Stack>
            </Router>
        )
    }
}



App.js
`/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  StatusBar,
  StyleSheet,
  Text,
  View
} from 'react-native';

import Routes from './src/Routes';

export default class App extends Component<{}> {
  render() {
    return (
      <View style={styles.container}>
          <StatusBar
              backgroundColor="#6b9b37"
              barStyle="light-content"
          />
          <View style={{ flex:1 }}>
              <Routes />
          </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
 container : {
   backgroundColor:'#9ccc65',
   flex:1,
   alignItems:'center',
   alignContent: 'center',
 }
});
`
### Steps to reproduce
For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.
2.
3.

<!-- Love react-native-router-flux? Please consider supporting our collective:
👉  https://opencollective.com/react-native-router-flux/donate -->

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

21reactions
chiragshetacommented, Mar 1, 2018

Or you can do one thing just remove alignItems:'center', from style it will fix your problems.

2reactions
chiragshetacommented, Mar 1, 2018

This is not working inside View use return <Routes /> insted of

return (
      <View style={styles.container}>
          <StatusBar
              backgroundColor="#6b9b37"
              barStyle="light-content"
          />
          <View style={{ flex:1 }}>
              <Routes />
          </View>
      </View>
    );
Read more comments on GitHub >

github_iconTop Results From Across the Web

router flux in react native not showing the screen
you don't need to put Stack tag, just put like this. <Router> <Scene key="root" hideNavBar > //put all scene inside it <Scene initial...
Read more >
Developers - router-flux-blank-screen showing where initial screen ...
Showing only blank screen with container style inside and top bar colored to green. Routes.js import React, {Component} from 'react'; import {Router, Stack, ......
Read more >
react-native-router-flux | Yarn - Package Manager
It helps users to define all the routes in one central place and navigate and communicate between different screens in an easy way....
Read more >
react-native-router-flux/CHANGELOG.md - UNPKG
277, - router-flux-blank-screen showing where initial screen should be [\#2909](https://github.com/aksonov/react-native-router-flux/issues/2909).
Read more >
React Native Tutorial #5 | Tek Hub - YouTube
React Native - Screen Navigation using react-native- router - flux Useful Books: 1. ... We will help to learn and solve issues in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found