0

I am new to react native, I created a sample application for navigation between screen but I am facing some issue. I have attached the screen shot.enter image description here

code I have used in App.js

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

import { StackNavigator } from 'react-navigation';
import  FirstScreen  from './screens/FirstScreen'
import  SecondScreen  from './screens/SecondScreen'

const Navigation = StackNavigator({
First: {screen: FirstScreen},
Second: {screen: SecondScreen}
});

export default Navigation; // Export your root navigator as the root component

second screen code:

import React from 'react';
import {Text, View, Button} from 'react-native';
const util = require('util');

export default class SecondScreen extends React.Component {
static navigationOptions = {
    title: 'Second screen',
};

render() {
    console.log("this.props.navigation.state = " + util.inspect(this.props.navigation.state, false, null));
    var {params} = this.props.navigation.state;
    return (
        <View>
            <Text>This is screen 2</Text>
            <Text>Params from screen1 : {params.name}, email = {params.email}</Text>
        </View>
    );
}
  }

These code I got form github.

jerfin
  • 803
  • 1
  • 13
  • 28

1 Answers1

-1

Refer below link. You have to clear cache and run again.

How to clear react-native cache?

There would be a chance for a path issue or some error in second screen code. Make a simple hello world on the second screen.

Jayakumar Thangavel
  • 1,884
  • 1
  • 22
  • 29