【发布时间】:2019-04-23 09:59:27
【问题描述】:
我在我的 RN 项目中使用来自 WIX 的 React Native Navigation v2。对于仪表板(goToDahboard)堆栈,我需要在单击显示侧抽屉的左侧显示汉堡包图标。如何实现?
从 v1 升级后,侧边菜单选项发生了变化,文档不够清晰。
export const goToDashboard = () =>
Promise.all([
Icon.getImageSource('home', 22, '#272727'),
Icon.getImageSource('th-list', 22, '#272727'),
]).then(sources => {
Navigation.setRoot({
root: {
bottomTabs: {
children: [
{
stack: {
children: [
{
component: {
name: 'Dashboard',
},
},
],
options: {
bottomTab: {
icon: sources[0],
text: 'Dashboard',
},
},
},
},
{
stack: {
children: [
{
component: {
name: 'Settings',
},
},
],
options: {
bottomTab: {
icon: sources[1],
text: 'Settings',
},
},
},
},
],
id: 'bottomTabs',
},
},
});
});
export const goToAuth = () =>
Navigation.setRoot({
root: {
stack: {
id: 'Login',
children: [
{
component: {
name: 'Login',
},
},
],
},
},
});
【问题讨论】:
标签: react-native wix-react-native-navigation