1- import React , { FC , MutableRefObject } from "react" ;
1+ import React , { MutableRefObject } from "react" ;
22import { render } from "@testing-library/react" ;
33import { renderHook } from "@testing-library/react-hooks" ;
44
@@ -40,7 +40,7 @@ describe("useNestedDialogFixes", () => {
4040 > ;
4141
4242 const firstResult : Result = { current : undefined } ;
43- const First : FC = ( ) => {
43+ function First ( ) {
4444 firstResult . current = useNestedDialogFixes ( {
4545 id : "dialog-1" ,
4646 visible : true ,
@@ -49,10 +49,10 @@ describe("useNestedDialogFixes", () => {
4949 } ) ;
5050
5151 return null ;
52- } ;
52+ }
5353
5454 const secondResult : Result = { current : undefined } ;
55- const Second : FC = ( ) => {
55+ function Second ( ) {
5656 secondResult . current = useNestedDialogFixes ( {
5757 id : "dialog-2" ,
5858 visible : true ,
@@ -61,14 +61,16 @@ describe("useNestedDialogFixes", () => {
6161 } ) ;
6262
6363 return null ;
64- } ;
64+ }
6565
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+ }
7274
7375 render ( < Test /> ) ;
7476 expect ( firstResult . current ) . toEqual ( {
@@ -87,7 +89,7 @@ describe("useNestedDialogFixes", () => {
8789 const warn = jest . spyOn ( console , "warn" ) ;
8890 // hide warnings
8991 warn . mockImplementation ( ( ) => { } ) ;
90- const Dialog : FC = ( ) => {
92+ function Dialog ( ) {
9193 useNestedDialogFixes ( {
9294 id : "dialog-id" ,
9395 visible : true ,
@@ -96,15 +98,16 @@ describe("useNestedDialogFixes", () => {
9698 } ) ;
9799
98100 return null ;
99- } ;
100- const Test : FC = ( ) => {
101+ }
102+
103+ function Test ( ) {
101104 return (
102105 < NestedDialogContextProvider >
103106 < Dialog />
104107 < Dialog />
105108 </ NestedDialogContextProvider >
106109 ) ;
107- } ;
110+ }
108111
109112 const { unmount } = render ( < Test /> ) ;
110113 unmount ( ) ;
0 commit comments