@@ -33,6 +33,7 @@ import {
33
33
UNSAFE_DataRouterStateContext as DataRouterStateContext ,
34
34
UNSAFE_NavigationContext as NavigationContext ,
35
35
UNSAFE_RouteContext as RouteContext ,
36
+ UNSAFE_logV6DeprecationWarnings as logV6DeprecationWarnings ,
36
37
UNSAFE_mapRouteProperties as mapRouteProperties ,
37
38
UNSAFE_useRouteId as useRouteId ,
38
39
UNSAFE_useRoutesImpl as useRoutesImpl ,
@@ -716,6 +717,11 @@ export function RouterProvider({
716
717
[ router . future . v7_relativeSplatPath ]
717
718
) ;
718
719
720
+ React . useEffect (
721
+ ( ) => logV6DeprecationWarnings ( future , router . future ) ,
722
+ [ future , router . future ]
723
+ ) ;
724
+
719
725
// The fragment and {null} here are important! We need them to keep React 18's
720
726
// useId happy when we are server-rendering since we may have a <script> here
721
727
// containing the hydrated server-side staticContext (from StaticRouterProvider).
@@ -807,6 +813,8 @@ export function BrowserRouter({
807
813
808
814
React . useLayoutEffect ( ( ) => history . listen ( setState ) , [ history , setState ] ) ;
809
815
816
+ React . useEffect ( ( ) => logV6DeprecationWarnings ( future ) , [ future ] ) ;
817
+
810
818
return (
811
819
< Router
812
820
basename = { basename }
@@ -858,6 +866,8 @@ export function HashRouter({
858
866
859
867
React . useLayoutEffect ( ( ) => history . listen ( setState ) , [ history , setState ] ) ;
860
868
869
+ React . useEffect ( ( ) => logV6DeprecationWarnings ( future ) , [ future ] ) ;
870
+
861
871
return (
862
872
< Router
863
873
basename = { basename }
@@ -905,6 +915,8 @@ function HistoryRouter({
905
915
906
916
React . useLayoutEffect ( ( ) => history . listen ( setState ) , [ history , setState ] ) ;
907
917
918
+ React . useEffect ( ( ) => logV6DeprecationWarnings ( future ) , [ future ] ) ;
919
+
908
920
return (
909
921
< Router
910
922
basename = { basename }
0 commit comments