Search code examples
react-nativereact-native-navigationwix-react-native-navigation

How to add side menu icon in wix-react-native-navigation v2?


I am new to react-native. i want to add side menu icon like the following image enter image description here

in wix-react-native-navigation v1 was fairly simple. We need to just add

{
  tabs:[
    screen: "myscreenName",
    label: "MyLabel",
    icon: require('icon-url')
  ]
}

But in V2 documentation they said if you add to side menu use this but they didn't say about how to add icon.

{
  root: {
    sideMenu: {
      left: {
        component: {
          name: 'sideDrawer'
        }
      },
      center: {
        bottomTabs: {
          .....
        }
      }
    }
  }
}

As a result a side drawer is appear if i dragged from left side but the icon is missing. Any idea ho do i add a icon like this on wix-react-native-navigation v2


Solution

  • You can check this link https://github.com/wix/react-native-navigation/issues/796

    The hamburger button is no longer added by default since a lot of users asked to control when it's displayed and when not. In every screen you'd like to have the hamburger button, add it explicitly:

    static navigatorButtons = { leftButtons: [ { id: 'sideMenu' } ] };