Kureev / react-native-side-menu

Side menu component for React Native
MIT License
2.21k stars 436 forks source link

Where did the Menu tags come from? #363

Open edoantonioco opened 5 years ago

edoantonioco commented 5 years ago

Son on the example of how to use this there is this render() { const menu = <Menu navigator={navigator}/>; but react native tell me it Canf find variable Menu.

So the < Menu > tag, where does it come from? and the navigator.

ZHamburglar commented 5 years ago

The Menu Tag is just a placeholder for what you want in the menu. From the actual package index.js: https://github.com/react-native-community/react-native-side-menu/blob/master/index.js `render(): React.Element<void, void> { const menu = ( <View style={[styles.menu, boundryStyle]}> {this.props.menu} ); return ( <View style={styles.container} onLayout={this.onLayoutChange}

{menu} {this.getContentView()} ); }`

So this means whatever you pass down as the menu object will be rendered in the Sidemenu. This will yield a side menu that says "The Side Menu is Open":


render() {

    const menu = <Text>The Side Menu is Open</Text>;

    return (
          <SideMenu menu={menu}>
               <ContentView/>
           </SideMenu>
    );
  }
sellomkantjwa commented 5 years ago

@ ZHamburglar And the navigator?