#<BrowserRouter> and viewTransition not compatible ?

1 messages · Page 1 of 1 (latest)

woven hollow
#

Hey folks,

With react-router v7, it seems viewTransition is not compatible with <BrowserRouter>, but only with <RouterProvider> (and createBrowserRouter()).
Considering <BrowserRouter> is not deprecated in V7, it seems quite surprising that it's not compatible ?
Is it planned in the future ?

Or maybe the documentation could explain / say it's not compatible here :
https://reactrouter.com/how-to/view-transitions#basic-view-transition
?
and also here ?
https://reactrouter.com/start/library/navigating

I am using react-router 7 without file-based routing and no feature flags enabled.

Thanks in advance!

woven hollow
#

<BrowserRouter> and viewTransition not compatible ?

woven hollow
#

In the end the question is, is it possible to keep the <BrowserRouter> to do some viewTransition ?
In order to achieve some fade transitions between pages routes 🙂

chilly ridge
#

I've seen some other things that were definitely not possible without the createBrowserRouter() and provider way, so I'd probably opt to use that anyways. The docs don't mention it but if you search for the function name you can find answers to other questions where that function was needed