Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass Value from Drawer To <Scene in Drawer #2919

Closed
Donhv opened this issue Mar 4, 2018 · 4 comments
Closed

Pass Value from Drawer To <Scene in Drawer #2919

Donhv opened this issue Mar 4, 2018 · 4 comments

Comments

@Donhv
Copy link

Donhv commented Mar 4, 2018

I use react-native-drawer and react-native-router-flux v4.
My router:

<Router>
<Scene key="root" hideNavBar={true} >
<Scene overlay contentComponent={contentComponent}>
<Scene key="Basic" initial={true} component={Basic} title="Basic" />
</Scene>
</Router> 

My contentComponent:
<Drawer onOpen={() => this.setState({ isDrawerOpen: true })} >
{React.cloneElement(this.props.children[0], YourProps: this.state.isDrawerOpen })}
</Drawer>

Now i want pass state isDrawerOpen to component Basic. i want when drawer open will set a state in Basic.
Anyone can help me?

@asciifaceman
Copy link
Contributor

Can you reformat your post using tripple ticks ``` which should make it a bit more readable.

I'm also not quiiiiite following what you are trying to do. I think I have an idea, but could you elaborate before I make suggestions?

@Donhv
Copy link
Author

Donhv commented Mar 13, 2018

@asciifaceman thanks for reply :D

@asciifaceman
Copy link
Contributor

I'm trying to understand the flow of what is going on here.

You are rendering Basic inside the drawer are you not? And it looks like you were trying to pass in isOpen with YourProps?

@aksonov
Copy link
Owner

aksonov commented Aug 8, 2018

Please try to reproduce it with Example project and latest version 4.0.0-beta.40. Feel free to open if the issue still exists

@aksonov aksonov closed this as completed Aug 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants