Complete the code to import the stack navigator from React Navigation.
import { create[1] } from '@react-navigation/stack';
The function to create a stack navigator is createStackNavigator from '@react-navigation/stack'.
Complete the code to create a stack navigator instance.
const Stack = [1]();You call createStackNavigator() to create the stack navigator instance.
Fix the error in the code to define a screen inside the stack navigator.
<Stack.Navigator> <Stack.Screen name="Home" component=[1] /> </Stack.Navigator>
The component prop must be a React component, such as HomeScreen.
Fill both blanks to navigate to the Profile screen using the navigation prop.
navigation.[1]('[2]');
Use navigation.navigate('Profile') to go to the Profile screen.
Fill all three blanks to define a stack navigator with two screens: HomeScreen and ProfileScreen.
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name=[1] component=[2] />
<Stack.Screen name=[3] component={ProfileScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}The first screen's name is "Home" and component is HomeScreen. The second screen's name is "Profile".