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

Compatibility with react-native-navigation modals on android #77

Open
johakr opened this issue May 17, 2018 · 4 comments
Open

Compatibility with react-native-navigation modals on android #77

johakr opened this issue May 17, 2018 · 4 comments
Labels

Comments

@johakr
Copy link

johakr commented May 17, 2018

Hi,

first of all, thanks for this awesome library.

I noticed that the snackbars won't show on android in modals if one uses react-native-navigation. Imho, this is due to the fact, that react-native modals are rendered in the view hiearchy of the current activity, but react-native-navigation modals aren't (as they are internally Dialogs). Therefore, they are not found by the current implementation of recursiveLoopChildren.

I fixed it on my fork at https://github.com/johakr/react-native-snackbar. However, this enforces react-native-navigation as a dependency and is therefore not compatible with projects not using react-native-navigation.

To be honest, I currently have no idea and no time to figure out how to make this work for both kind of projects (those using react-native-navigation and those using standard react-native modals). Maybe someone wants to take a look at it and bring it into a mergable state.

For those using react-native-navigation and struggling with getting snackbars working in modals, feel free to use my fork as an interim solution.

@cooperka
Copy link
Owner

Thank you @johakr! Permalink to commit: https://github.com/johakr/react-native-snackbar/commit/c1d485d3e3ab8b7b608adc97dc0636264472e10f.

If anyone is willing to make a more general PR for this I'd be happy to merge.

@cooperka cooperka added the bug label May 19, 2018
@cooperka
Copy link
Owner

cooperka commented May 19, 2018

Also see #28 for a similar issue.

@murat-mehmet
Copy link

How can I use this commit in my project? Modifications in node_modules are lost easily. Could you drop it in npm to be installed please, because I'm having the same problem and need this fix. Thanks for this great lib!

@johakr
Copy link
Author

johakr commented Aug 30, 2018

@coderproject You can install the fork directly from github, no need for npm. Just update your package.json to "react-native-snackbar": "johakr/react-native-snackbar"

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

No branches or pull requests

3 participants