Closed
Description
Version
"react-native-drawer": "^2.3.0",
"react-native-router-flux": "^3.36.0",
"react-native": "0.36.0",
I try to add a Drawer menu to my app. I took the code from the documentation. If I add the NavigationDrawer component to the wrapping scene element the navigation bar isn't displayed.
Any idea what's wrong in my code?
export default class App extends Component {
render() {
return (
<View style={{ flex: 1 }}>
<StatusBar
backgroundColor="#ffffff00"
barStyle="light-content"
translucent
/>
<Provider store={store}>
<RouterWithRedux>
<Scene key="drawer" open={true} >
<Scene key="main" initial={true} component={Main} title="My APP"/>
<Scene key="page1" component={Page1} title="Page 1"/>
</Scene>
</RouterWithRedux>
</Provider>
</View>
)
}
}
Drawer Navigation Code
export default class NavigationDrawer extends Component {
constructor(props){
super(props);
}
render(){
const state = this.props.navigationState;
const children = state.children;
return (
<Drawer
ref="navigation"
open={state.open}
onOpen={()=>Actions.refresh({key:state.key, open: true})}
onClose={()=>Actions.refresh({key:state.key, open: false})}
type="displace"
content={<SideMenu />}
tapToClose={true}
openDrawerOffset={0.2}
panCloseMask={0.2}
negotiatePan={true}
tweenHandler={(ratio) => ({
main: { opacity:Math.max(0.54,1-ratio) }
})}>
<DefaultRenderer navigationState={children[0]} onNavigate={this.props.onNavigate} />
</Drawer>
);
}
}
If I remove the DrawerNavigation form the first scene element the navigation bar is displayed again.
Metadata
Metadata
Assignees
Labels
No labels