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

how do you do a Infinite loop for the routes? #8

Open
888jacklee opened this issue May 27, 2018 · 8 comments
Open

how do you do a Infinite loop for the routes? #8

888jacklee opened this issue May 27, 2018 · 8 comments

Comments

@888jacklee
Copy link

is there a way to do a Infinite loop for the routes?

e.g. to start over again when reach the end of the routes

@sanfilippopablo
Copy link
Owner

I'm pretty sure you can't do this right now. I'm leaving this open because it'd be a nice to have.

@cbourlon
Copy link

cbourlon commented May 4, 2019

Hey @sanfilippopablo, is there something new about this issue? Do you think ''react-swipeable-views-utils" could be integrated in some way?

Thanks a lot this very nice package by the way ;)

@sanfilippopablo
Copy link
Owner

Hi @cbourlon ! I'm planning to add virtual routes from that package. That'd allow SwipeableRoutes to support infinite loops and lazy loading of routes. Maybe I can implement that this weekend.

@cbourlon
Copy link

Hey @sanfilippopablo,

Thanks for your answer. I made an other independent component next to swipeableroutes and it works fine for my purpose but I’m sure that others would be happy to use your implementation if you find time to make it.

Thanks again for this package and your work ;) That’s very nice!

@develleoper
Copy link

Their virtualize and slideRenderer functionality would also help immensely with using route match params!

Also +1 on thanks to you for this package! It's so good

@888jacklee
Copy link
Author

Great Stuff!!!

@sanfilippopablo
Copy link
Owner

@develleoper

Their virtualize and slideRenderer functionality would also help immensely with using route match params!

How so? I want to implement the virtualize interoperability, and I'm considering the use cases

@r-saba
Copy link

r-saba commented Jan 27, 2021

I'm currently doing this to simulate infinite loops. Essentially a swipewable route where the last route redirects to the first route

<PrivateRoute exact path={['/', ROUTES.HOME]}>
  {<Redirect to={ROUTES.DISCOVER.url} />}
</PrivateRoute>
<SwipeableRoutes>
  <PrivateRoute path={ROUTES.DISCOVER.url} component={DiscoverPage} />
  <PrivateRoute path={ROUTES.UPCOMING.url} component={UpcomingPage} />
  <PrivateRoute path={ROUTES.MY_EVENTS.url} component={MyEventsPage} />
  <PrivateRoute exact path={ROUTES.HOME}></PrivateRoute>
</SwipeableRoutes>

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

5 participants