@@ -28,9 +28,11 @@ import {
28
28
useSubmit ,
29
29
useFetcher ,
30
30
useFetchers ,
31
- UNSAFE_resetModuleScope ,
32
31
UNSAFE_DataRouterStateContext ,
33
- } from "../index" ;
32
+ } from "react-router-dom" ;
33
+
34
+ // Private API
35
+ import { _resetModuleScope } from "../../react-router/lib/components" ;
34
36
35
37
testDomRouter ( "<DataBrowserRouter>" , DataBrowserRouter , ( url ) =>
36
38
getWindowImpl ( url , false )
@@ -40,7 +42,11 @@ testDomRouter("<DataHashRouter>", DataHashRouter, (url) =>
40
42
getWindowImpl ( url , true )
41
43
) ;
42
44
43
- function testDomRouter ( name , TestDataRouter , getWindow ) {
45
+ function testDomRouter (
46
+ name : string ,
47
+ TestDataRouter : typeof DataBrowserRouter ,
48
+ getWindow : ( initialUrl : string , isHash ?: boolean ) => Window
49
+ ) {
44
50
describe ( name , ( ) => {
45
51
let consoleWarn : jest . SpyInstance ;
46
52
let consoleError : jest . SpyInstance ;
@@ -52,7 +58,7 @@ function testDomRouter(name, TestDataRouter, getWindow) {
52
58
afterEach ( ( ) => {
53
59
consoleWarn . mockRestore ( ) ;
54
60
consoleError . mockRestore ( ) ;
55
- UNSAFE_resetModuleScope ( ) ;
61
+ _resetModuleScope ( ) ;
56
62
} ) ;
57
63
58
64
it ( "renders the first route that matches the URL" , ( ) => {
0 commit comments