react-swipeable-routes icon indicating copy to clipboard operation
react-swipeable-routes copied to clipboard

how do you do a Infinite loop for the routes?

Open 888jacklee opened this issue 7 years ago • 8 comments

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

888jacklee avatar May 27 '18 14:05 888jacklee

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

sanfilippopablo avatar Jun 18 '18 14:06 sanfilippopablo

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 ;)

cbourlon avatar May 04 '19 11:05 cbourlon

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.

sanfilippopablo avatar May 06 '19 17:05 sanfilippopablo

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!

cbourlon avatar May 20 '19 19:05 cbourlon

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

develleoper avatar Aug 01 '19 23:08 develleoper

Great Stuff!!!

888jacklee avatar Aug 01 '19 23:08 888jacklee

@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

sanfilippopablo avatar Aug 24 '19 00:08 sanfilippopablo

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>

r-saba avatar Jan 27 '21 18:01 r-saba