root-two / react-native-drawer

React Native Drawer
MIT License
2.54k stars 390 forks source link

Cannot close drawer from drawer content #336

Closed ghost closed 6 years ago

ghost commented 6 years ago

I am using React native 0.50. How can i Close navigator from content?

Importing drawer content from another component import Drawercontent from "./app/components/drawer";

Here is my content content={<Drawercontent/>}

inside drawer content

export default class Drawercontent extends Component {
return (
      <View style={[styles.containerNoraml,styles.drawrContainer]}>
        <ListView
        dataSource={this.state.dataSource}
        renderRow={(rowData) =>
            <TouchableHighlight onPress={()=>{closeDrawer()}} underlayColor="#d9e2f3">
                <View style={styles.slideMenuList}>
                    <View style={styles.slideMenuIconContainer}>
                        <Image style={styles.slideMenuIcon} source={rowData.icon}/>
                    </View>
                    <Text style={styles.slideMenuText}>{rowData.text}</Text>
                </View>
            </TouchableHighlight>}/>
      </View>
      )
}

I want close my drawer using closeDrawer() function