Per the RN documentation, the proper way to use merge
is as follows:
navigation.navigate({
name: 'Post',
params: { postTitle: 'An okay post' },
merge: true,
});
I'd like to use merge
in my app, however my navigate function looks a bit different:
navigation.navigate("mainScreen", { screen: "secondaryScreen" })
I want the route params that were initially passed to mainScreen
to persist. I know that I can use merge: true
like in the documentation. However my navigate function is a bit different, and I'm not sure where to put merge:true
. Is there a proper place for this, or is there a way that I can translate my navigate function to look like the one in the documentation?