Hellow I added Login Page with your tutorial, But I Can't see login and signup, Just I have a White Screen and after 10 secend I got setting a timer for a long period, What Should I Do?
This is my Code: index.android.js
import React, { Component } from 'react';
import CustomComponents from 'react-native-deprecated-custom-components';
import SplashScreen from 'react-native-splash-screen'
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import App from './component/App'
import * as firebase from 'firebase'
import Login from './component/Login'
import FireBaseApp from './lib/firebase'
export default class Mohajerkade extends Component {
constructor(props) {
super(props)
this.state = {
initialView: null,
userLoaded: false
}
this.getInitialView()
this.getInitialView = this.getInitialView.bind(this)
}
getInitialView() {
firebase.auth().onAuthStateChanged((user) => {
let initialView = user ? 'App' : 'Login'
this.setState({
userLoaded: true,
initialView
})
})
}
componentDidMount() {
SplashScreen.hide();
}
configureScene(route) {
if (route.sceneConfig) {
return route.sceneConfig
} else {
return ({
...CustomComponents.Navigator.SceneConfigs.HorizontalSwipeJumpFromRight,
gestures:{}
});
}
}
renderScene(route, navigator) {
var globalProps = { navigator }
switch (route.id) {
case 'App':
return (
<App navigator={navigator} />
)
case 'Login':
return (
<Login navigator={navigator} />
)
}
}
render() {
if (this.userLoaded) {
return (
<CustomComponents.Navigator
initialRoute={{
id: this.state.initialView
}}
renderScene={this.renderScene}
configureScene={this.configureScene}
/>
);
} else {
return null
}
}
}
AppRegistry.registerComponent('Mohajerkade', () => Mohajerkade);
Hellow I added Login Page with your tutorial, But I Can't see login and signup, Just I have a White Screen and after 10 secend I got
setting a timer for a long period
, What Should I Do? This is my Code:index.android.js
And This is my Login Page Code: