React-native-router-flux: router-flux-blank-screen showing where initial screen should be

Created on 28 Feb 2018  Â·  11Comments  Â·  Source: aksonov/react-native-router-flux

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 (





)
}
}

App.js
`/**

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 (
backgroundColor="#6b9b37"
barStyle="light-content"
/>



);
}
}

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.

Most helpful comment

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

All 11 comments

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>
    );

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

Thank you so much

Dne 1. 3. 2018 6:49 dop. napsal uživatel "chiragsheta" <
[email protected]>:

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

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/aksonov/react-native-router-flux/issues/2909#issuecomment-369481361,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AZ36nRxXb-1-3MEAfSFb59EZL-A4EB6oks5tZ4v-gaJpZM4SWhKJ
.

@chiragsheta

Could you explain why removing alignItems:'center' fix the problem?
I was stuck with my code.. Did that and it's working now!

Thanks

After that background color is not showing

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

I see. It is almost impossible to support such project alone, during only free time

Error i get when using RNRF

package.json

{
"name": "ABC",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"axios": "^0.18.0",
"eslint": "^5.2.0",
"native-base": "2.6.1",
"react": "16.3.1",
"react-native": "0.54.0",
"react-native-router-flux": "^4.0.1",
"react-native-timeline-listview": "^0.2.3",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.3.0"
},
"rnpm": {
"assets": [
"app/resources/fonts",
"app/resources/img"
]
}
}

index.js

import React from 'react';
import { AppRegistry } from 'react-native';
// Root for enabling Toast
import { Root } from "native-base";
import { Router, Scene } from 'react-native-router-flux';
import { Provider } from 'react-redux';
import store from './app/store/store';

import PostAd from './app/components/PostAd';
import SignUp from './app/components/SignUp';

const App = () => (







);

AppRegistry.registerComponent('ABC', () => App);

log:

08-13 13:17:09.919 23416 23416 D ReactNative: ReactInstanceManager.onJSBundleLoadedFromServer()
08-13 13:17:09.919 23416 23416 D ReactNative: ReactInstanceManager.recreateReactContextInBackground()
08-13 13:17:09.919 23416 23416 D ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
08-13 13:17:09.919 23416 23416 D ReactNative: ReactInstanceManager.tearDownReactContext()
08-13 13:17:09.919 23416 23416 D ReactNative: CatalystInstanceImpl.destroy() start
08-13 13:17:09.924 23416 23531 D ReactNative: ReactInstanceManager.createReactContext()
08-13 13:17:10.054 23416 23531 D ReactNative: Initializing React Xplat Bridge.
08-13 13:17:10.064 23416 23531 D ReactNative: Initializing React Xplat Bridge before initializeBridge
08-13 13:17:10.109 23416 23534 D ReactNative: CatalystInstanceImpl.destroy() end
08-13 13:17:10.114 23416 23531 D ReactNative: Initializing React Xplat Bridge after initializeBridge
08-13 13:17:10.114 23416 23531 D ReactNative: CatalystInstanceImpl.runJSBundle()
08-13 13:17:10.114 23416 23536 D ReactNative: ReactInstanceManager.setupReactContext()
08-13 13:17:10.114 23416 23536 D ReactNative: CatalystInstanceImpl.initialize()
08-13 13:17:10.114 23416 23536 D ReactNative: ReactInstanceManager.attachRootViewToInstance()
08-13 13:17:11.729 23416 23535 I ReactNativeJS: Running application "PINTP2P" with appParams: {"rootTag":11}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
08-13 13:17:11.909 23416 23535 E ReactNativeJS: TypeError: undefined is not an object (evaluating 'context.changedBits')
08-13 13:17:11.909 23416 23535 E ReactNativeJS:
08-13 13:17:11.909 23416 23535 E ReactNativeJS: This error is located at:
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in SceneView (at StackViewLayout.js:563)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:562)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:561)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at createAnimatedComponent.js:147)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in AnimatedComponent (at StackViewCard.js:12)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Card (at createPointerEventsContainer.js:28)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Container (at StackViewLayout.js:612)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:470)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:469)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in StackViewLayout (at withOrientation.js:30)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in withOrientation (at StackView.js:63)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at Transitioner.js:169)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Transitioner (at StackView.js:21)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in StackView (at createNavigator.js:59)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Navigator (at createKeyboardAwareNavigator.js:11)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in KeyboardAwareNavigator (at createNavigationContainer.js:376)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in NavigationContainer (at Router.js:97)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in App (at Router.js:122)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Router (at index.js:16)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in Provider (at index.js:15)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in App (at renderApplication.js:35)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at AppContainer.js:102)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in View (at AppContainer.js:122)
08-13 13:17:11.909 23416 23535 E ReactNativeJS: in AppContainer (at renderApplication.js:34)
08-13 13:17:11.929 23416 23535 W ReactNativeJS: Warning: Unexpected pop.
08-13 13:17:11.939 23416 23535 E ReactNativeJS: TypeError: Attempted to assign to readonly property.
08-13 13:17:11.939 23416 23535 E ReactNativeJS:
08-13 13:17:11.939 23416 23535 E ReactNativeJS: This error is located at:
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in SceneView (at StackViewLayout.js:563)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:562)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:561)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at createAnimatedComponent.js:147)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in AnimatedComponent (at StackViewCard.js:12)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Card (at createPointerEventsContainer.js:28)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Container (at StackViewLayout.js:612)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:470)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at StackViewLayout.js:469)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in StackViewLayout (at withOrientation.js:30)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in withOrientation (at StackView.js:63)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at Transitioner.js:169)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Transitioner (at StackView.js:21)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in StackView (at createNavigator.js:59)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Navigator (at createKeyboardAwareNavigator.js:11)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in KeyboardAwareNavigator (at createNavigationContainer.js:376)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in NavigationContainer (at Router.js:97)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in App (at Router.js:122)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Router (at index.js:16)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in Provider (at index.js:15)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in App (at renderApplication.js:35)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at AppContainer.js:102)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in RCTView (at View.js:78)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in View (at AppContainer.js:122)
08-13 13:17:11.939 23416 23535 E ReactNativeJS: in AppContainer (at renderApplication.js:34)
08-13 13:17:11.949 23416 23535 W ReactNativeJS: Warning: Unexpected pop.
08-13 13:17:11.949 23416 23535 E ReactNativeJS: Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.

@chiragsheta way works

Thank you so much Dne 1. 3. 2018 6:49 dop. napsal uživatel "chiragsheta" < [email protected]>:
…
Or you can do one thing just remove alignItems:'center', from style it will fix your problems. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#2909 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AZ36nRxXb-1-3MEAfSFb59EZL-A4EB6oks5tZ4v-gaJpZM4SWhKJ .

This thread literally saved my life! Huge thanks!

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

Thank You !! it works, but what is the reason ?

Was this page helpful?
0 / 5 - 0 ratings