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

Allow passing route parameters to modals #19

Closed
lakardion opened this issue Apr 16, 2023 · 2 comments
Closed

Allow passing route parameters to modals #19

lakardion opened this issue Apr 16, 2023 · 2 comments

Comments

@lakardion
Copy link

Hello Kanzitelli. I'm loving navio since 0.0.1 !

Do you think we could allow modals to receive route parameters? Or is there already a way to do this? (btw tried setParams but did not understand fully how that should used for a modal screen)

I happened to require using a modal to confirm an action and to do it within the modal I needed some information (ig: ids)

I saw that with regular react navigation you could just pass params and the screen would receive that from useRoute().params

Right now I'm using global state to pass the information to my modal but would definitely be really useful to just do:

navio.show('myModal', { usefulId: 'someid' } )

Similar to how navio.push signature is.

@kanzitelli
Copy link
Owner

Hey @lakardion! Happy to hear that! And I'm currently on the vacation, couldn't reply quickly.

Currently with navio it's possible but using react-navigation's instance navio.N. This is what you can do:

navio.N.navigate('MyModal', { screen: 'ScreenName', params: { usefulId: 'someid' }, });

Check out this issue for more info.

@lakardion
Copy link
Author

Awesome. That is 100% what I needed.

thank you very much. Cheers

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

2 participants