MMA301_-_SU_2023_-_2_514.webp
M

MMA301_-_SU_2023_-_2_514.webp

(11
(Choose 1 answer)
Study the code below and select the correct answer:
const Stack = createNativeStack Navigator();
function App() {
return (
<NavigationContainer>
<Stack.Navigator initial RouteName="Home">
<Stack.Screen name="Home" component={HomeScreen} />
<Stack.Screen name="Details" component={Details Screen} />
</Stack.Navigator>
</NavigationContainer>
);
A. This code is correct and sets up the stack navigator. It contains two screens in the stack, Home and Details, with an initial route to the Home screen.
B. This code is incorrect. The stack navigator should not wrap the stack screens. You can also not specify an initial route name within the stack. This code will produce an error.
C. This code is correct and sets up the stack navigator. It contains two screens in the stack, Home and Details, with an initial route to the Details screen.
D. This code is correct and sets up the stack navigator. It contains two screens in the stack, Home and Details, with an initial route to the Home and Details screens.


  • Like
Reactions: Quangdung

Thông tin

Category
MMA301
Thêm bởi
minhduc94
Ngày thêm
Lượt xem
2,448
Lượt bình luận
13
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
MMA301_-_SU_2023_-_2_514.webp
File size
78.3 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom