Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
iOS and Android apps with React Native - Switching between screens with React Native Navigation
import React from 'react';
import PropTypes from 'prop-types';
class LoginScreen extends React.Component {
// ...
componentWillReceiveProps(newProps) {
if (newProps.authenticated === true) {
handleSuccessfulLogin() {
screen: 'MyApp.Dashboard',
backButtonHidden: true,
animated: true,
animationType: 'fade',
render() {
// ..
LoginScreen.propTypes = {
authenticated: PropTypes.bool.isRequired,
navigator: PropTypes.shape({
resetTo: PropTypes.func.isRequired,
export default LoginScreen;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment