question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrap Drawer around Router

See original GitHub issue

Hey there. I am trying to wrap the react-native-side-menu component around the Router, so it is on top and not under the navBar. I really can´t figure out where the right place is to put it and especially how to pass the Router props down/up to the SideMenu Routes. This was my try:

class App extends Component {
  render() {
    return (
        <SideMenu
            menu={<Components.Menu/>}
            isOpen={false}
        >
            <Router
                firstRoute={{
                    name: 'LOGIN',
                    component: Login
                }}
                headerStyle={{
                    backgroundColor: 'black',
                    elevation: 5
                }}
                backButtonComponent={ Components.BackButton }
            />
        </SideMenu>
    );
  }
}

Now how can i pass toRoute props to Components.Menu?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
BigPun86commented, Apr 3, 2016

@shakdoesgithub i ended up using react-native-drawer with type overlay. If you want to have the side menu covering the complete side it is opened then you should add the noStatusBar prop to your router…

1reaction
eljagocommented, Mar 4, 2016
render() {
  return (
    <SideMenu
      menuPosition='right'
      touchToClose={true}
      isOpen={this.state.isOpen}
      disableGestures={true}
      menu={
        <Menu onPress={this._onPress.bind(this)} />
      }
    >
      <Router
        ref={'router'}
        firstRoute={routes.Cinemas}
        headerStyle={styles.header}
        backButtonComponent={BackButton}
        customAction={this._openMenu.bind(this)}
        handleBackAndroid={true}
        rightCorner={MenuButton}
      />
    </SideMenu>
  );
}

_onPress(routeData) {
  this.refs.router.onForward(routeData, this.refs.router.refs.navigator);
}

I tried this and the main view animates to the left, with the navigation bar staying in place. Also got the following warning:

Warning: flattenChildren(...): Encountered two children with the same key, `.$scene_0`. Child keys must be unique; when two children share a key, only the first child will be used.
Read more comments on GitHub >

github_iconTop Results From Across the Web

The biggest wireless router placement mistake - CNET
Before you declare your router an eyesore and banish it to a basket, read this. ... wrapping them in gift wrap, or putting...
Read more >
Making Cabinet Doors Using a Router Table
In this tutorial I am going to show you how I made shaker style drawer fronts using a router table and rail and...
Read more >
Router Table Cabinet - Instructables
1. Materials (1-1/2 sheets) 3/4″ plywood (1 sheet) 1/2″ plywood (1 pair) Euro hinges – frameless ½ overlay (2 pairs) 20” Drawer slides (4) 3” locking caster ......
Read more >
Not so Ordinary Router Cabinet | Popular Woodworking
Wrap up work on the drawer by pinning the drawer bottom to the completed drawer box. Build a Better Door. 1. After completing...
Read more >
Lock Miter and Drawer Lock Router Bits [Archive] - Sawmill Creek ...
I'm making a jewerly box using some 1/2" Quarter Sawn Curly Maple and I want to let the grain wrap around real nice...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found