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

onEnter event supported on Drawer component ? Want to call function when user open Drawer #3204

Closed
anishroff opened this issue Aug 23, 2018 · 4 comments

Comments

@anishroff
Copy link

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.1 (v3 is not supported)
  • react-native v0.55.1
                <Drawer
                  hideNavBar
                  key="drawer"
                  contentComponent={SideMenu}
                  drawerImage={MenuIcon}
                  drawerWidth={300}
                  onEnter={() => alert("in drawer")}
                >

Expected behaviour

I want to call a function in component after user opens the Drawer. I tried with above code with no luck.

Actual behaviour

onEnter alert is not shown when Drawer is opened. Is it supported on Drawer ? How to track if event of user opened Drawer ?

Steps to reproduce

For non-obvious bugs, please fork this component, modify Example project to reproduce your issue and include link here.
1.
2.
3.

@daviscabral
Copy link
Collaborator

Can you try this?

                <Scene 
                  drawer
                  hideNavBar
                  key="drawer"
                  contentComponent={SideMenu}
                  drawerImage={MenuIcon}
                  drawerWidth={300}
                  onEnter={() => alert("in drawer")}
                >

@daviscabral
Copy link
Collaborator

It seems that you got it working - in case it's not and you believe it's a bug - feel free to reopen the ticket.

@daviscabral daviscabral added invalid for stack overflow Better suited for Stack Overflow and removed needs response from author labels Sep 1, 2018
@anishroff
Copy link
Author

@daviscabral Apologise for delay. It doesn't work this way as well. How can I help to find the issue, please assist.

@daviscabral
Copy link
Collaborator

@anishroff I've added support for it in a PR.

@daviscabral daviscabral reopened this Sep 11, 2018
daviscabral added a commit that referenced this issue Sep 11, 2018
@daviscabral daviscabral added enhancement and removed for stack overflow Better suited for Stack Overflow invalid labels Sep 11, 2018
aksonov pushed a commit that referenced this issue Sep 12, 2018
* #3204 onEnter/onExit for Drawer

* Lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants