react-native-side-menu icon indicating copy to clipboard operation
react-native-side-menu copied to clipboard

Where did the Menu tags come from?

Open edoantonioco opened this issue 7 years ago • 2 comments

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.

edoantonioco avatar Oct 05 '18 03:10 edoantonioco

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} </View> ); return ( <View style={styles.container} onLayout={this.onLayoutChange} > {menu} {this.getContentView()} </View> ); }

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>
    );
  }


ZHamburglar avatar Nov 21 '18 23:11 ZHamburglar

@ ZHamburglar And the navigator?

sellomkantjwa avatar Jun 16 '19 15:06 sellomkantjwa