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

Passing params in two pane navigation #128

Open
Vedantthakkar opened this issue Mar 16, 2022 · 2 comments
Open

Passing params in two pane navigation #128

Vedantthakkar opened this issue Mar 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@Vedantthakkar
Copy link

Hi,

I am making an app for dual screen devices using the TwoPaneApp component of twopane navigation. At some of the places in my app I need to pass values as params but I don't see any way to do that using this library. If there is a way please help me out by posting a solution. If it's not possible currently, it will be great enhancement to this library.

@ghost ghost added the Needs: triage 🔍 label Mar 16, 2022
@chrisglein
Copy link
Member

Can you clarify your scenario a bit more and what you've tried? What sort of values are you looking to pass and to what?

@Vedantthakkar
Copy link
Author

Vedantthakkar commented Mar 21, 2022

There are certain components in my app that enables or disables different features and areas in the app based on certain values(Eg. user permissions(string enum) and requestId(number) ). These values are better suited to be passed as params rather than props as they can also be undefined and the screen renders the default view. As most of the components in my app doesn't require props I have made a function and default config something like this:

config = {
key: string,
component: React Component
}
navigate (key) {
// Add the key to the stack using autopane
}

Now when we use react-navigation for single screen devices there is a React navigation context that provides the current route and the params provided to the route. And I am looking to see something similar to that where we can pass values as params and can access it inside the component using the context ( Like navigationContext.getParam()).

@chrisglein chrisglein added enhancement New feature or request and removed Needs: attention 👋 labels Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants