Skip to content
Advertisement

How to navigate from one screen to another in React native?

When I click on Sign Up button I want to navigate to Sign up page but it did not work. I have imported the screens and navigated screen also to app.js file. I am getting an ReferenceError : Can’t find variable: navigation. Also I am unable to insert background image? Below is the Sign Up page.

JavaScript

Advertisement

Answer

onPress handler does not getting called with navigation as the first parameter. That is undefined. navigation is a prop to your class component which is provided by stack navigator setup.

Instead of

JavaScript

use

JavaScript
Advertisement