I have created drawer using react-native-drawer
. drawer View contains ListView
. Whenever click the renderRow
method need to show navigation inside the drawer itself instead of top of the Welcome
screen stack.
Right now: Check the Screenshot here
Expected: want to achieve something like this - Multi Level Menu
File: Component/welcome.js
render(){
var settingPanel = <Setting closeDrawer={ () => {
this.drawer.close();
}} />
return(
<Drawer
ref={c => this.drawer = c}
type='overlay'
content={settingPanel}
...>
<Home />
</Drawer>
);
}
File: Component/setting.js
render(){
return(
<ListView
dataSource={this.state.dataSource}
renderRow={this.renderRow.bind(this)}
/>
);
}
renderRow (items) {
return(
<View>
<Text style={styles.rowText}>{items.name}</Text>
<ImageButton onPress={Actions.trans()} img={fb} />
</View>
)
};
Its navigating on top of the Welcome
screen. I need to navigate on the drawer itself. How could I achieve this?
from it's documentation here
options to open drawer Three options:
Use the open prop (controlled mode):
Using the Drawer Ref:
Using Context
then to navigate to another component using react-native-router-flux you can add a
TouchableOpacity
component insted of<home />
then inonPress
addactions.home()
and home is the key of react-native-router-flux scene component