Complete the code to navigate to the Details screen with a parameter.
navigation.navigate('Details', { userId: [1] });
We pass the userId as a string inside the object when navigating.
Complete the code to read the parameter 'userId' from route params in the Details screen.
const { [1] } = route.params;We extract 'userId' from route.params to use it in the screen.
Fix the error in the code to correctly pass multiple parameters when navigating.
navigation.navigate('Profile', { name: [1], age: [2] });
Both parameters must be passed as separate key-value pairs inside the object.
Fill both blanks to correctly define a function that navigates with a parameter.
function goToDetails([1]) { navigation.[2]('Details', { itemId: 5 }); }
The function receives the navigation object and calls its navigate method.
Fill all three blanks to create a button that navigates to 'Home' with a parameter 'welcome' set to true.
return ( <Button title="Go Home" onPress={() => navigation.[1]('[2]', { [3]: true })} /> );
The button calls navigation.navigate to the 'Home' screen with the parameter 'welcome' set to true.