Skip to content

Commit

Permalink
docs: Fixed swapped button titles
Browse files Browse the repository at this point in the history
  • Loading branch information
stanleyoos committed Aug 7, 2024
1 parent ecc8b59 commit e5e490b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
8 changes: 4 additions & 4 deletions static/examples/5.x/stack-actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { View, Button, Text } from 'react-native';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react';
import { Button, Text, View } from 'react-native';

function HomeScreen({ navigation }) {
return (
Expand Down Expand Up @@ -31,11 +31,11 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button
title="Push same screen on the stack"
title="Pop one screen from stack"
onPress={() => navigation.dispatch(StackActions.pop(1))}
/>
<Button
title="Pop one screen from stack"
title="Push same screen on the stack"
onPress={() =>
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }))
}
Expand Down
8 changes: 4 additions & 4 deletions static/examples/6.x/stack-actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { View, Button, Text } from 'react-native';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react';
import { Button, Text, View } from 'react-native';

function HomeScreen({ navigation }) {
return (
Expand Down Expand Up @@ -31,11 +31,11 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button
title="Push same screen on the stack"
title="Pop one screen from stack"
onPress={() => navigation.dispatch(StackActions.pop(1))}
/>
<Button
title="Pop one screen from stack"
title="Push same screen on the stack"
onPress={() =>
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }))
}
Expand Down
8 changes: 4 additions & 4 deletions static/examples/7.x/stack-actions.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { View, Button, Text } from 'react-native';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import * as React from 'react';
import { Button, Text, View } from 'react-native';

function HomeScreen({ navigation }) {
return (
Expand Down Expand Up @@ -31,11 +31,11 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button
title="Push same screen on the stack"
title="Pop one screen from stack"
onPress={() => navigation.dispatch(StackActions.pop(1))}
/>
<Button
title="Pop one screen from stack"
title="Push same screen on the stack"
onPress={() =>
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }))
}
Expand Down
32 changes: 16 additions & 16 deletions versioned_docs/version-7.x/stack-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ function ProfileScreen({ route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -142,14 +142,14 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -246,14 +246,14 @@ function ProfileScreen({ route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -322,14 +322,14 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -411,14 +411,14 @@ function ProfileScreen({ route }) {
// codeblock-focus-end
}}
>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -491,14 +491,14 @@ function ProfileScreen({ navigation, route }) {
// codeblock-focus-end
}}
>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button onPress={() => navigation.dispatch(StackActions.popToTop())}>
Pop to top
Expand Down Expand Up @@ -593,14 +593,14 @@ function ProfileScreen({ route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button
onPress={() => {
Expand Down Expand Up @@ -673,14 +673,14 @@ function ProfileScreen({ navigation, route }) {
<Text>Profile!</Text>
<Text>{route.params.user}'s profile</Text>
<Button onPress={() => navigation.dispatch(StackActions.pop(1))}>
Push same screen on the stack
Pop one screen from stack
</Button>
<Button
onPress={() => {
navigation.dispatch(StackActions.push('Profile', { user: 'Wojtek' }));
}}
>
Pop one screen from stack
Push same screen on the stack
</Button>
<Button
onPress={() => {
Expand Down

0 comments on commit e5e490b

Please sign in to comment.