Skip to content

Commit 4461a3c

Browse files
committed
Update passing params back docs
1 parent c601cd0 commit 4461a3c

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

static/examples/5.x/passing-params-back.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ function CreatePostScreen({ navigation, route }) {
3737
<Button
3838
title="Done"
3939
onPress={() => {
40-
// Pass params back to home screen
41-
navigation.navigate('Home', { post: postText });
40+
// Pass and merge params back to home screen
41+
navigation.navigate({
42+
name: 'Home',
43+
params: { post: postText },
44+
merge: true,
45+
});
4246
}}
4347
/>
4448
</>

versioned_docs/version-5.x/params.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,12 @@ function CreatePostScreen({ navigation, route }) {
131131
<Button
132132
title="Done"
133133
onPress={() => {
134-
// Pass params back to home screen
135-
navigation.navigate('Home', { post: postText });
134+
// Pass and merge params back to home screen
135+
navigation.navigate({
136+
name: 'Home',
137+
params: { post: postText },
138+
merge: true,
139+
});
136140
}}
137141
/>
138142
</>

0 commit comments

Comments
 (0)