React Navigation Flashcards

1
Q

createNativeStackNavigator

A

is a function that returns an object containing 2 properties: Screen and Navigator.

Both are React components used for configuring the navigator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

NavigationContainer

A

is a component which manages our navigation tree and contains the navigation state.

The navigation container must wrap all navigators structure and is rendered at the root of our app, which is usually the component exported from App.js.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Navigation State

A

is the state where React Navigation stores the navigation structure and history of the app.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the navigation state look like?

A

const state = {
type: ‘stack’,
key: ‘stack-1’,
routeNames: [‘Home’, ‘Profile’,
‘Settings’],
routes: [
{ key: ‘home-1’, name:
‘Home’, params: { sortBy:
‘latest’ } },
{ key: ‘settings-1’, name:
‘Settings’ },
],
index: 1,
stale: false,
};

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Stack.Navigator

A

is a component that takes route configuration as its children with additional props for configuration and renders our content.

The Navigator should contain Screen elements as its children to define the configuration for routes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Stack.Screen

A

requires a name prop which refers to the name of the route

requires component prop which specifies the component to render for the route.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly