Using <Switch> in routes

Hey all, thanks so much for the hard work!

I’m running into issues when trying to use a <Switch> in my routes. Is this currently not supported? I’d like to handle my various layouts in the router of possible.

You are correct, this is currently not supported. But we’re working on a solution!

1 Like

Sweet, thanks @Tobbe!

1 Like

This might not be its final form, everything might change from now and until it’s delivered. But this is the current WIP prototype

1 Like

Hi, is the Switch in routes not supported yet?

Hi @juarez-dev

Our router is different compared to react-router. Our default behavior is the same behavior you’d get with <Switch> in react-router.

Is there something you’ve tried to do that doesn’t work for you?

I was trying to implement transitions between routes using React Spring, like this way:
transitioning between routes with React Spring
or this one:
React Transition Group with react router

Thanks,

1 Like

I was trying to implement transitions between routes

Thanks for letting me know about the use-case! This is something I haven’t tried myself yet, but it’s definitely something I think our router should have support for!

I’m open to ideas on how to implement it in the router code :slight_smile:

1 Like

@juarez-dev We started talking a little bit about animation in this issue:

Feel free to jump in with your thoughts/ideas/comments :slight_smile:

1 Like