diff --git a/playground/src/screens/WelcomeScreen.js b/playground/src/screens/WelcomeScreen.js
index 4bb78ab3ebb..4d166feb67c 100644
--- a/playground/src/screens/WelcomeScreen.js
+++ b/playground/src/screens/WelcomeScreen.js
@@ -53,6 +53,7 @@ class WelcomeScreen extends Component {
+
{`this.props.componentId = ${this.props.componentId}`}
@@ -60,6 +61,51 @@ class WelcomeScreen extends Component {
);
}
+ onClickSwitchToStack = () => {
+ Navigation.setRoot({
+ root: {
+ stack: {
+ id: 'MyStack',
+ children: [
+ {
+ component: {
+ name: 'navigation.playground.ProfileScreen',
+ passProps: {
+ text: 'This is Profile',
+ myFunction: () => 'Hello from a function!'
+ },
+ }
+ },
+ {
+ component: {
+ name: 'navigation.playground.LoginScreen',
+ passProps: {
+ text: 'This is Login',
+ myFunction: () => 'Hello from a function!'
+ },
+ }
+ }
+ ],
+ options: {
+ topBar: {
+ visible: false,
+ }
+ }
+ },
+ }
+ })
+
+ // lets pretend this is async action dispatched from store
+ // basically user logs in > dispatch an action > change screen to Profile
+ setTimeout(() => {
+ Navigation.push('MyStack', {
+ component: {
+ name: 'navigation.playground.ProfileScreen'
+ }
+ })
+ }, 3000)
+ }
+
onClickSwitchToTabs = () => {
Navigation.setRoot({
root: {
diff --git a/playground/src/screens/index.js b/playground/src/screens/index.js
index 8c6eb480575..8ddcbc01258 100644
--- a/playground/src/screens/index.js
+++ b/playground/src/screens/index.js
@@ -49,6 +49,9 @@ function registerScreens() {
Navigation.registerComponent('CustomTextButton', () => CustomTextButton);
Navigation.registerComponent('CustomRoundedButton', () => CustomRoundedButton);
Navigation.registerComponent('TopBarBackground', () => TopBarBackground);
+
+ Navigation.registerComponent('navigation.playground.LoginScreen', () => TextScreen)
+ Navigation.registerComponent('navigation.playground.ProfileScreen', () => TextScreen)
}
module.exports = {