React native this.props.navigation.navigate undefinedDisabling buttons on react nativeShow splash screen before show main screen in react native without using 3rd party libraryReact Native: TypeError: undefined is not an object (evaluating 'this.props.navigation.navigate')React Native - Touches not working after initializing app with splash screen and navigation.setRoot()How to push a new scene using react-navigation?how to navigate to homescreen onPress of login button in react native?I am using React-native and node js.I am not able to navigate from one screen to another after getting response from Node jsReact Native Navigation invoke all screens componentDidMount/componentWillMount when navigated to Home after loginGetting error for navigation in segment - react-nativeReact native navigation (undefined is not an object .. this.props.navigation.navigate
declaring a variable twice in IIFE
If Manufacturer spice model and Datasheet give different values which should I use?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Chess with symmetric move-square
N.B. ligature in Latex
Why was the small council so happy for Tyrion to become the Master of Coin?
Is it possible to do 50 km distance without any previous training?
What is the meaning of "of trouble" in the following sentence?
How to make payment on the internet without leaving a money trail?
Is there a minimum number of transactions in a block?
Could a US political party gain complete control over the government by removing checks & balances?
What do you call a Matrix-like slowdown and camera movement effect?
Accidentally leaked the solution to an assignment, what to do now? (I'm the prof)
Download, install and reboot computer at night if needed
Example of a relative pronoun
How is it possible for user's password to be changed after storage was encrypted? (on OS X, Android)
What is the command to reset a PC without deleting any files
Circuitry of TV splitters
Simulate Bitwise Cyclic Tag
Motorized valve interfering with button?
Why is the design of haulage companies so “special”?
Can a German sentence have two subjects?
How to calculate implied correlation via observed market price (Margrabe option)
Can an x86 CPU running in real mode be considered to be basically an 8086 CPU?
React native this.props.navigation.navigate undefined
Disabling buttons on react nativeShow splash screen before show main screen in react native without using 3rd party libraryReact Native: TypeError: undefined is not an object (evaluating 'this.props.navigation.navigate')React Native - Touches not working after initializing app with splash screen and navigation.setRoot()How to push a new scene using react-navigation?how to navigate to homescreen onPress of login button in react native?I am using React-native and node js.I am not able to navigate from one screen to another after getting response from Node jsReact Native Navigation invoke all screens componentDidMount/componentWillMount when navigated to Home after loginGetting error for navigation in segment - react-nativeReact native navigation (undefined is not an object .. this.props.navigation.navigate
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
navigation.js
import React, Component from 'react'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import SplashScreen from './screens/splashScreen'
// export const Nav = createStackNavigator(
// splashScreen: screen: SplashScreen ,
// loginScreen: screen:Login ,
// , initialRouteName: 'splashScreen' )
// export default createAppContainer(Nav);
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(Nav);
splashscreen.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer from '../styleSheet'
import Nav from '../navigations'
import createStackNavigator,createAppContainer from 'react-navigation'
class SplashScreen extends Component
componentWillMount()
setTimeout(() =>
// alert('I will redirect')
this.props.navigation.navigate("loginScreen");
, 3000);
render()
return (
<View style=appContainer.AppContainer>
<Text style=appContainer.splashSC> Who Around Me </Text>
</View>
)
export default SplashScreen
login.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer,buttons from '../styleSheet'
class Login extends Component
render()
return (
<View style=appContainer.AppContainer>
<Text style=buttons.loginBtnText>
Login with Sim
</Text>
</View>
)
export default Login
App.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<Nav />
);
export default App;
index.android.js
import React, Component from "react";
import AppRegistry from "react-native";
import createStackNavigator,createAppContainer from 'react-navigation'
import App from "./src/App";
AppRegistry.registerComponent("WhoAroundMe", () => App);
this.props.navigation.navigate("loginScreen"); throws error
this.props.navigation.navigate undefined
Could not able to resolve by doing alot google.
Any help appreciated.
Thanks
android react-native react-navigation react-navigation-stack
add a comment |
navigation.js
import React, Component from 'react'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import SplashScreen from './screens/splashScreen'
// export const Nav = createStackNavigator(
// splashScreen: screen: SplashScreen ,
// loginScreen: screen:Login ,
// , initialRouteName: 'splashScreen' )
// export default createAppContainer(Nav);
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(Nav);
splashscreen.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer from '../styleSheet'
import Nav from '../navigations'
import createStackNavigator,createAppContainer from 'react-navigation'
class SplashScreen extends Component
componentWillMount()
setTimeout(() =>
// alert('I will redirect')
this.props.navigation.navigate("loginScreen");
, 3000);
render()
return (
<View style=appContainer.AppContainer>
<Text style=appContainer.splashSC> Who Around Me </Text>
</View>
)
export default SplashScreen
login.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer,buttons from '../styleSheet'
class Login extends Component
render()
return (
<View style=appContainer.AppContainer>
<Text style=buttons.loginBtnText>
Login with Sim
</Text>
</View>
)
export default Login
App.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<Nav />
);
export default App;
index.android.js
import React, Component from "react";
import AppRegistry from "react-native";
import createStackNavigator,createAppContainer from 'react-navigation'
import App from "./src/App";
AppRegistry.registerComponent("WhoAroundMe", () => App);
this.props.navigation.navigate("loginScreen"); throws error
this.props.navigation.navigate undefined
Could not able to resolve by doing alot google.
Any help appreciated.
Thanks
android react-native react-navigation react-navigation-stack
add a comment |
navigation.js
import React, Component from 'react'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import SplashScreen from './screens/splashScreen'
// export const Nav = createStackNavigator(
// splashScreen: screen: SplashScreen ,
// loginScreen: screen:Login ,
// , initialRouteName: 'splashScreen' )
// export default createAppContainer(Nav);
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(Nav);
splashscreen.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer from '../styleSheet'
import Nav from '../navigations'
import createStackNavigator,createAppContainer from 'react-navigation'
class SplashScreen extends Component
componentWillMount()
setTimeout(() =>
// alert('I will redirect')
this.props.navigation.navigate("loginScreen");
, 3000);
render()
return (
<View style=appContainer.AppContainer>
<Text style=appContainer.splashSC> Who Around Me </Text>
</View>
)
export default SplashScreen
login.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer,buttons from '../styleSheet'
class Login extends Component
render()
return (
<View style=appContainer.AppContainer>
<Text style=buttons.loginBtnText>
Login with Sim
</Text>
</View>
)
export default Login
App.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<Nav />
);
export default App;
index.android.js
import React, Component from "react";
import AppRegistry from "react-native";
import createStackNavigator,createAppContainer from 'react-navigation'
import App from "./src/App";
AppRegistry.registerComponent("WhoAroundMe", () => App);
this.props.navigation.navigate("loginScreen"); throws error
this.props.navigation.navigate undefined
Could not able to resolve by doing alot google.
Any help appreciated.
Thanks
android react-native react-navigation react-navigation-stack
navigation.js
import React, Component from 'react'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import SplashScreen from './screens/splashScreen'
// export const Nav = createStackNavigator(
// splashScreen: screen: SplashScreen ,
// loginScreen: screen:Login ,
// , initialRouteName: 'splashScreen' )
// export default createAppContainer(Nav);
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(Nav);
splashscreen.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer from '../styleSheet'
import Nav from '../navigations'
import createStackNavigator,createAppContainer from 'react-navigation'
class SplashScreen extends Component
componentWillMount()
setTimeout(() =>
// alert('I will redirect')
this.props.navigation.navigate("loginScreen");
, 3000);
render()
return (
<View style=appContainer.AppContainer>
<Text style=appContainer.splashSC> Who Around Me </Text>
</View>
)
export default SplashScreen
login.js
import React, Component from "react";
import Image, StyleSheet, Text, TouchableOpacity, View from "react-native";
import appContainer,buttons from '../styleSheet'
class Login extends Component
render()
return (
<View style=appContainer.AppContainer>
<Text style=buttons.loginBtnText>
Login with Sim
</Text>
</View>
)
export default Login
App.js
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
* @lint-ignore-every XPLATJSCOPYRIGHT1
*/
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<Nav />
);
export default App;
index.android.js
import React, Component from "react";
import AppRegistry from "react-native";
import createStackNavigator,createAppContainer from 'react-navigation'
import App from "./src/App";
AppRegistry.registerComponent("WhoAroundMe", () => App);
this.props.navigation.navigate("loginScreen"); throws error
this.props.navigation.navigate undefined
Could not able to resolve by doing alot google.
Any help appreciated.
Thanks
android react-native react-navigation react-navigation-stack
android react-native react-navigation react-navigation-stack
edited Mar 8 at 10:14
Md. Parvez Alam
asked Mar 8 at 6:00
Md. Parvez AlamMd. Parvez Alam
1,85121338
1,85121338
add a comment |
add a comment |
5 Answers
5
active
oldest
votes
I can't clearly understand the problem well, but you can try adding SplashScreen in createStackNavigator()
in navigation.js
file
const StackNavigator = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(StackNavigator);
In your App.js file replace with this:
const App = () => (
<Nav /> //instead of SplashScreen
);
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
|
show 14 more comments
It is because your SplashScreen Component is not declared as a route in react-navigation. when you create route, you can put SplashScreen as route and set it as initial route name.
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
add a comment |
Pass the ...props when calling SplashScreen component
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<SplashScreen ...props />
);
export default App;
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
add a comment |
Try to implement this
App.js
import React, Component from "react";
import Platform, StyleSheet, Text, View from "react-native";
import SplashScreen from "./splashScreen";
import createStackNavigator, createAppContainer from "react-navigation";
import Nav from "./navigations";<----changes-----
export default class App extends Component
render()
return (
<Nav />
);
Nav.js
import React, Component from "react";
import createStackNavigator, createAppContainer from "react-navigation";
import Login from "./login";
import SplashScreen from "./splashScreen";
//<------replace your code from here
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen
,
initialRouteName: "splashScreen"
);
export default createAppContainer(Nav);
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
|
show 2 more comments
The main issue was I was importing navigations.js in screen files.
Thanks all for your valuable comments I learned lots of things from you brothers
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057548%2freact-native-this-props-navigation-navigate-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
5 Answers
5
active
oldest
votes
5 Answers
5
active
oldest
votes
active
oldest
votes
active
oldest
votes
I can't clearly understand the problem well, but you can try adding SplashScreen in createStackNavigator()
in navigation.js
file
const StackNavigator = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(StackNavigator);
In your App.js file replace with this:
const App = () => (
<Nav /> //instead of SplashScreen
);
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
|
show 14 more comments
I can't clearly understand the problem well, but you can try adding SplashScreen in createStackNavigator()
in navigation.js
file
const StackNavigator = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(StackNavigator);
In your App.js file replace with this:
const App = () => (
<Nav /> //instead of SplashScreen
);
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
|
show 14 more comments
I can't clearly understand the problem well, but you can try adding SplashScreen in createStackNavigator()
in navigation.js
file
const StackNavigator = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(StackNavigator);
In your App.js file replace with this:
const App = () => (
<Nav /> //instead of SplashScreen
);
I can't clearly understand the problem well, but you can try adding SplashScreen in createStackNavigator()
in navigation.js
file
const StackNavigator = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen,
initialRouteName: 'splashScreen',
)
export default createAppContainer(StackNavigator);
In your App.js file replace with this:
const App = () => (
<Nav /> //instead of SplashScreen
);
edited Mar 8 at 8:39
answered Mar 8 at 6:30
Piyush GovilPiyush Govil
1038
1038
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
|
show 14 more comments
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
did that worked for you @Md. Parvez Alam?
– Piyush Govil
Mar 8 at 7:36
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
did you import SplashScreen in navigation.js ?
– Piyush Govil
Mar 8 at 8:16
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
Yes I did the same
– Md. Parvez Alam
Mar 8 at 8:17
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
But when I give initialRouteName it returns 500 error
– Md. Parvez Alam
Mar 8 at 8:18
|
show 14 more comments
It is because your SplashScreen Component is not declared as a route in react-navigation. when you create route, you can put SplashScreen as route and set it as initial route name.
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
add a comment |
It is because your SplashScreen Component is not declared as a route in react-navigation. when you create route, you can put SplashScreen as route and set it as initial route name.
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
add a comment |
It is because your SplashScreen Component is not declared as a route in react-navigation. when you create route, you can put SplashScreen as route and set it as initial route name.
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
It is because your SplashScreen Component is not declared as a route in react-navigation. when you create route, you can put SplashScreen as route and set it as initial route name.
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
export const Nav = createStackNavigator(
splashScreen:
screen: SplashScreen
,
loginScreen:
screen:Login
,
initialRouteName: 'splashScreen'
)
answered Mar 8 at 7:48
Hazim AliHazim Ali
3223822
3223822
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
add a comment |
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
it says splashScreen must be react component
– Md. Parvez Alam
Mar 8 at 8:11
add a comment |
Pass the ...props when calling SplashScreen component
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<SplashScreen ...props />
);
export default App;
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
add a comment |
Pass the ...props when calling SplashScreen component
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<SplashScreen ...props />
);
export default App;
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
add a comment |
Pass the ...props when calling SplashScreen component
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<SplashScreen ...props />
);
export default App;
Pass the ...props when calling SplashScreen component
import React, Component from 'react';
import Platform, StyleSheet, Text, View from 'react-native';
import SplashScreen from './screens/splashScreen'
import createStackNavigator,createAppContainer from 'react-navigation'
import Login from './screens/login'
import Nav from './navigations'
const App = () => (
<SplashScreen ...props />
);
export default App;
answered Mar 8 at 9:41
thodwristhodwris
143216
143216
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
add a comment |
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
Not working, remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:44
add a comment |
Try to implement this
App.js
import React, Component from "react";
import Platform, StyleSheet, Text, View from "react-native";
import SplashScreen from "./splashScreen";
import createStackNavigator, createAppContainer from "react-navigation";
import Nav from "./navigations";<----changes-----
export default class App extends Component
render()
return (
<Nav />
);
Nav.js
import React, Component from "react";
import createStackNavigator, createAppContainer from "react-navigation";
import Login from "./login";
import SplashScreen from "./splashScreen";
//<------replace your code from here
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen
,
initialRouteName: "splashScreen"
);
export default createAppContainer(Nav);
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
|
show 2 more comments
Try to implement this
App.js
import React, Component from "react";
import Platform, StyleSheet, Text, View from "react-native";
import SplashScreen from "./splashScreen";
import createStackNavigator, createAppContainer from "react-navigation";
import Nav from "./navigations";<----changes-----
export default class App extends Component
render()
return (
<Nav />
);
Nav.js
import React, Component from "react";
import createStackNavigator, createAppContainer from "react-navigation";
import Login from "./login";
import SplashScreen from "./splashScreen";
//<------replace your code from here
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen
,
initialRouteName: "splashScreen"
);
export default createAppContainer(Nav);
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
|
show 2 more comments
Try to implement this
App.js
import React, Component from "react";
import Platform, StyleSheet, Text, View from "react-native";
import SplashScreen from "./splashScreen";
import createStackNavigator, createAppContainer from "react-navigation";
import Nav from "./navigations";<----changes-----
export default class App extends Component
render()
return (
<Nav />
);
Nav.js
import React, Component from "react";
import createStackNavigator, createAppContainer from "react-navigation";
import Login from "./login";
import SplashScreen from "./splashScreen";
//<------replace your code from here
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen
,
initialRouteName: "splashScreen"
);
export default createAppContainer(Nav);
Try to implement this
App.js
import React, Component from "react";
import Platform, StyleSheet, Text, View from "react-native";
import SplashScreen from "./splashScreen";
import createStackNavigator, createAppContainer from "react-navigation";
import Nav from "./navigations";<----changes-----
export default class App extends Component
render()
return (
<Nav />
);
Nav.js
import React, Component from "react";
import createStackNavigator, createAppContainer from "react-navigation";
import Login from "./login";
import SplashScreen from "./splashScreen";
//<------replace your code from here
const Nav = createStackNavigator(
loginScreen: screen: Login ,
splashScreen: screen: SplashScreen
,
initialRouteName: "splashScreen"
);
export default createAppContainer(Nav);
edited Mar 8 at 10:38
answered Mar 8 at 9:51
Paras KoratParas Korat
8191524
8191524
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
|
show 2 more comments
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
remove intialRoutename says says splashScreen must be react component, else if add initialRouteName says syntax error near initialRouteName
– Md. Parvez Alam
Mar 8 at 9:53
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
have you add splashScreen: screen: SplashScreen, in your export const Nav = createStackNavigator( loginScreen: screen:Login ) navigation.js file ?
– Paras Korat
Mar 8 at 9:55
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
I have updated full source code
– Md. Parvez Alam
Mar 8 at 9:59
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
@Md.ParvezAlam i have updated my answer
– Paras Korat
Mar 8 at 10:08
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
Yes changing to Nav has been done after answer given by @piyush
– Md. Parvez Alam
Mar 8 at 10:12
|
show 2 more comments
The main issue was I was importing navigations.js in screen files.
Thanks all for your valuable comments I learned lots of things from you brothers
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
add a comment |
The main issue was I was importing navigations.js in screen files.
Thanks all for your valuable comments I learned lots of things from you brothers
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
add a comment |
The main issue was I was importing navigations.js in screen files.
Thanks all for your valuable comments I learned lots of things from you brothers
The main issue was I was importing navigations.js in screen files.
Thanks all for your valuable comments I learned lots of things from you brothers
answered Mar 8 at 10:39
Md. Parvez AlamMd. Parvez Alam
1,85121338
1,85121338
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
add a comment |
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
Happy to help :)
– Piyush Govil
Mar 8 at 11:00
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057548%2freact-native-this-props-navigation-navigate-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown