Is is possible to use navigation.toggleDrawer() in navigation options

后端 未结 2 1799
旧巷少年郎
旧巷少年郎 2021-01-28 13:34

In my navigation file , when I want to toggle drawer , get the following error :

TypeError: navigation.openDrawer is not a function.(In \'navigation.ope

2条回答
  •  野性不改
    2021-01-28 14:34

    While constructing navigation at options, you refer to the navigation of the stack, what cant perform draw actions, try to construct it on header itself


                 {
                        return {
                            headerLeft: (navigation) => 

    https://github.com/react-navigation/react-navigation/issues/55

提交回复
热议问题