Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

Where did the Menu tags come from? #363

Open
edoantonioco opened this issue Oct 5, 2018 · 2 comments
Open

Where did the Menu tags come from? #363

edoantonioco opened this issue Oct 5, 2018 · 2 comments

Comments

@edoantonioco
Copy link

edoantonioco commented Oct 5, 2018

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
Copy link

ZHamburglar commented Nov 21, 2018

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


@sellomkantjwa
Copy link

@ ZHamburglar And the navigator?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants