Skip to content

feat: [Question about the router] React router renders multiple routes  #28059

Closed as not planned
@noskovvkirill

Description

@noskovvkirill

Prerequisites

Describe the Feature Request

I'm curious why the router for React is setup in the way it does. It renders multiple routes (presumably for transitions) in parallel and that leads to various issues (useEffect behaves differently and we have to useIonViewDidEnter/useIonViewDidLeave). It's hard for us to enable shared layout animations (because once we push the new route the old one still exists). We are also stuck with the old version of the React router and don't get the latest features. We would like to consider other router alternatives.

Wouldn't it make more sense to set up ionic in a way that doesn't depend on a specific router, and then add animations using something like Framer Motion Layout animations? (https://www.framer.com/motion/layout-animations). It seems like this approach could simplify things. What do you think?

Describe the Use Case

We're thinking about using a Next.js Router or TanStack router instead. Before we make the switch, we want to make sure we're not overlooking anything important.

Describe Preferred Solution

Transitions are independent of the Router.

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions