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.

Common place for every component to use drawer

See original GitHub issue

Do I need to use <Drawer> object for every component OR can I use it commonly? . Currently I have to repeat this code for every component

   var Feed = React.createClass({
     render: function() {
        return (
         <Drawer
                ref={(ref) => this._drawer = ref}
                style={styles.drawerStyles}
               closedDrawerOffset={-3}
               tapToClose={true}
               openDrawerOffset={0.2}
                content={<ControlPanel navigator={this.props.navigator}/>} >

              <MainView 
                openControlPanel={this.openControlPanel} 
                 closeControlPanel={this.closeControlPanel} 
                 navigator={this.props.navigator}/>
  </Drawer>
    );
},
    closeControlPanel: function() {
      this._drawer.close()
     },
    openControlPanel: function() {
       this._drawer.open()
    },
    onStartPress: function() {
       this.props.navigator.replaceWithAnimation({name: 'feed'})
    }
  }); 



   **<MainView> is getting replaced by other component only while rest of the code is same**

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
waleedarshad-vfcommented, Sep 1, 2016

@joshuapinter sorry about that

1reaction
waleedarshad-vfcommented, Sep 1, 2016

@joshuapinter github is showing that you contributed to this repository. by the way if you have answer. you should pay attention to this tag. otherwise you can simply ignore it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Drawer Component With React Portals | Let's Build UI
The drawer positioning can be controlled by a prop: left, top, right or bottom. The drawer can be dismissed either when clicking on...
Read more >
Navigation drawer - Material Design
Destinations in a navigation drawer take the form of actionable list items. Each item describes its destination using a text label and optional...
Read more >
Material Components: Navigation drawer - YouTube
Navigation drawers are panels anchored to one edge of the screen that provide access to different destinations in the app to complete tasks ......
Read more >
Components of cabinet drawer - IVAN - Phụ kiện nội thất
Components of the cabinet drawer include: • Frame: The frame is produced first before making any furniture, which supports and connects the ...
Read more >
React Native:-How to use a common drawer and toolbar ...
So I got drawer and toolbar in all inner pages. But now the question is how do I have control over drawer and...
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