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

Handling modals #49

Open
jeanregisser opened this issue Sep 20, 2016 · 2 comments
Open

Handling modals #49

jeanregisser opened this issue Sep 20, 2016 · 2 comments

Comments

@jeanregisser
Copy link

For of all, thank you for creating this library and experimenting with it. I really like the stated goals.
I've been dreaming of having easy deep linking in a native app for a long time ;)

Now, I'm trying to see how to handle modal screens (fullscreen or popups).

So far I've tried the following:

<Router history={nativeHistory}>
  <StackRoute path="master" component={Master}>
    <StackRoute path="master2" component={Master}>
      <Route path="/" component={Home} overlayComponent={HomeHeader} />
      <Route path="/detail/:themeColor" component={Detail} overlayComponent={DetailHeader} />
    </StackRoute>
    <Route
      path="/modal"
      component={Modal}
      transition="vertical-card-stack"
    />
  </StackRoute>
</Router>

It works partially:

  • when I navigate to /modal, I get the correct behavior the first time
  • if I go back and navigate again, the modal gets displayed twice quickly
  • navigating to /detail/:themeColor animates the nav bar incorrectly

Also there's a warning displayed that says <TabsRoute> and <StackRoute> cannot be nested within <StackRoute>. So I know this wasn't intended to be done like this ;)

Is there another way to handle this?

@jeanregisser
Copy link
Author

I've also tried this:

<Router history={nativeHistory}>
  <StackRoute path="master" component={Master}>
    <Route path="/" component={Home} overlayComponent={HomeHeader} />
    <Route path="/detail/:themeColor" component={Detail} overlayComponent={DetailHeader} />
    <StackRoute
      path="master2"
      component={Master}
      transition="vertical-card-stack"
    >
      <Route path="/modal" component={Modal} overlayComponent={HomeHeader} />
    </StackRoute>
  </StackRoute>
</Router>

The main problem is the animation which directly hides the nav bar of the initial stack. And of course I still have the warning about nested <StackRoute>.

@frimoldi
Copy link

frimoldi commented Nov 4, 2016

Hey, I'm getting the same warning for nested <StackRoute>s. Did you solve this ?

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