Skip to content

RouterProvider API aligned with React Router "data router" (standard since 6.4) #7799

@jgarplind

Description

@jgarplind

Provide a general summary of the feature here

I (and others) would very much like to see an updated RouterProvider API, which plays nicely with React Router's new "data router" API which has been around for more than a year, since v6.4.

🤔 Expected Behavior?

https://react-spectrum.adobe.com/react-aria/routing.html#react-router should work seamlessly with https://reactrouter.com/6.29.0/routers/create-browser-router

😯 Current Behavior

I don't think that the APIs are well aligned?

React router enforces a coupling between their own <RouterProvider> and it's prop, routes.

React Aria's <RouterProvider> wants to sit between those two, something no longer possible.

💁 Possible Solution

  1. "Fix it". I'm afraid I'm not sure how much of an effort this might be, I'm just here to communicate a need.
  2. Deprecate it. If you are not intending to continue supporting React Router (this is quite an "old" API by now), it would be nice to have that clearly stated in the docs. Additionally, consider documenting robust workarounds, such as react-router with createBrowserRouter #7594 (yet to be used by me, so I can't vouch for it)

🔦 Context

Personally I'm trying to make the <Table> component work with a createBrowserRouter-based React Router setup.

Others seem to be struggling with similar issues:

💻 Examples

No response

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions