1
- import React , { FC , MutableRefObject } from "react" ;
1
+ import React , { MutableRefObject } from "react" ;
2
2
import { render } from "@testing-library/react" ;
3
3
import { renderHook } from "@testing-library/react-hooks" ;
4
4
@@ -40,7 +40,7 @@ describe("useNestedDialogFixes", () => {
40
40
> ;
41
41
42
42
const firstResult : Result = { current : undefined } ;
43
- const First : FC = ( ) => {
43
+ function First ( ) {
44
44
firstResult . current = useNestedDialogFixes ( {
45
45
id : "dialog-1" ,
46
46
visible : true ,
@@ -49,10 +49,10 @@ describe("useNestedDialogFixes", () => {
49
49
} ) ;
50
50
51
51
return null ;
52
- } ;
52
+ }
53
53
54
54
const secondResult : Result = { current : undefined } ;
55
- const Second : FC = ( ) => {
55
+ function Second ( ) {
56
56
secondResult . current = useNestedDialogFixes ( {
57
57
id : "dialog-2" ,
58
58
visible : true ,
@@ -61,14 +61,16 @@ describe("useNestedDialogFixes", () => {
61
61
} ) ;
62
62
63
63
return null ;
64
- } ;
64
+ }
65
65
66
- const Test = ( ) => (
67
- < NestedDialogContextProvider >
68
- < First />
69
- < Second />
70
- </ NestedDialogContextProvider >
71
- ) ;
66
+ function Test ( ) {
67
+ return (
68
+ < NestedDialogContextProvider >
69
+ < First />
70
+ < Second />
71
+ </ NestedDialogContextProvider >
72
+ ) ;
73
+ }
72
74
73
75
render ( < Test /> ) ;
74
76
expect ( firstResult . current ) . toEqual ( {
@@ -87,7 +89,7 @@ describe("useNestedDialogFixes", () => {
87
89
const warn = jest . spyOn ( console , "warn" ) ;
88
90
// hide warnings
89
91
warn . mockImplementation ( ( ) => { } ) ;
90
- const Dialog : FC = ( ) => {
92
+ function Dialog ( ) {
91
93
useNestedDialogFixes ( {
92
94
id : "dialog-id" ,
93
95
visible : true ,
@@ -96,15 +98,16 @@ describe("useNestedDialogFixes", () => {
96
98
} ) ;
97
99
98
100
return null ;
99
- } ;
100
- const Test : FC = ( ) => {
101
+ }
102
+
103
+ function Test ( ) {
101
104
return (
102
105
< NestedDialogContextProvider >
103
106
< Dialog />
104
107
< Dialog />
105
108
</ NestedDialogContextProvider >
106
109
) ;
107
- } ;
110
+ }
108
111
109
112
const { unmount } = render ( < Test /> ) ;
110
113
unmount ( ) ;
0 commit comments