Skip to main content
Version: 7.37.0

Root

setRoot()#

Used to set the UI of the application. Read more about the root hierarchy level in the docs section.

Parameters#

NameRequiredTypeDescription
layoutYesLayoutAny type of layout. BottomTabs, Stack, SideMenu, Component

Example#

Navigation.setRoot({
root: {
stack: {
children: [{
component: {
name: 'example.FirstTabScreen',
passProps: {
text: 'This is tab 1'
}
}
}],
options: {
bottomTab: {
text: 'Tab 1',
icon: require('../images/one.png'),
testID: 'FIRST_TAB_BAR_BUTTON'
}
}
}
}
});