@@ -27,7 +27,6 @@ import {
2727 Router ,
2828 UNSAFE_DataRouterContext as DataRouterContext ,
2929 UNSAFE_DataRouterStateContext as DataRouterStateContext ,
30- UNSAFE_DataStaticRouterContext as DataStaticRouterContext ,
3130 UNSAFE_enhanceManualRouteObjects as enhanceManualRouteObjects ,
3231} from "react-router-dom" ;
3332
@@ -98,6 +97,7 @@ export function StaticRouterProvider({
9897 router,
9998 navigator : getStatelessNavigator ( ) ,
10099 static : true ,
100+ staticContext : context ,
101101 basename : context . basename || "/" ,
102102 } ;
103103
@@ -119,22 +119,18 @@ export function StaticRouterProvider({
119119
120120 return (
121121 < >
122- < DataStaticRouterContext . Provider value = { context } >
123- < DataRouterContext . Provider value = { dataRouterContext } >
124- < DataRouterStateContext . Provider
125- value = { dataRouterContext . router . state }
122+ < DataRouterContext . Provider value = { dataRouterContext } >
123+ < DataRouterStateContext . Provider value = { dataRouterContext . router . state } >
124+ < Router
125+ basename = { dataRouterContext . basename }
126+ location = { dataRouterContext . router . state . location }
127+ navigationType = { dataRouterContext . router . state . historyAction }
128+ navigator = { dataRouterContext . navigator }
126129 >
127- < Router
128- basename = { dataRouterContext . basename }
129- location = { dataRouterContext . router . state . location }
130- navigationType = { dataRouterContext . router . state . historyAction }
131- navigator = { dataRouterContext . navigator }
132- >
133- < Routes />
134- </ Router >
135- </ DataRouterStateContext . Provider >
136- </ DataRouterContext . Provider >
137- </ DataStaticRouterContext . Provider >
130+ < Routes />
131+ </ Router >
132+ </ DataRouterStateContext . Provider >
133+ </ DataRouterContext . Provider >
138134 { hydrateScript ? (
139135 < script
140136 suppressHydrationWarning
0 commit comments