@@ -270,10 +270,10 @@ describe("Trans component", () => {
270
270
} )
271
271
272
272
it ( "should render nested elements with `asChild` pattern" , ( ) => {
273
- const ComponentThatExpectsSingleElementChild : React . FC < {
273
+ function ComponentThatExpectsSingleElementChild ( props : {
274
274
asChild : boolean
275
275
children ?: React . ReactElement
276
- } > = ( props ) => {
276
+ } ) {
277
277
if ( props . asChild && React . isValidElement ( props . children ) ) {
278
278
return props . children
279
279
}
@@ -387,9 +387,7 @@ describe("Trans component", () => {
387
387
} )
388
388
389
389
it ( "should take defaultComponent prop with a custom component" , ( ) => {
390
- const ComponentFC : React . FunctionComponent < TransRenderProps > = (
391
- props
392
- ) => {
390
+ function ComponentFC ( props : TransRenderProps ) {
393
391
return < div > { props . children } </ div >
394
392
}
395
393
const span = render (
@@ -406,9 +404,7 @@ describe("Trans component", () => {
406
404
] ) (
407
405
"should ignore defaultComponent when `component` or `render` is null" ,
408
406
( props ) => {
409
- const ComponentFC : React . FunctionComponent < TransRenderProps > = (
410
- props
411
- ) => {
407
+ function ComponentFC ( props : TransRenderProps ) {
412
408
return < div > { props . children } </ div >
413
409
}
414
410
const translation = render (
@@ -434,9 +430,7 @@ describe("Trans component", () => {
434
430
435
431
it ( "should render function component as simple prop" , ( ) => {
436
432
const propsSpy = jest . fn ( )
437
- const ComponentFC : React . FunctionComponent < TransRenderProps > = (
438
- props
439
- ) => {
433
+ function ComponentFC ( props : TransRenderProps ) {
440
434
propsSpy ( props )
441
435
const [ state ] = React . useState ( "value" )
442
436
return < div id = { props . id } > { state } </ div >
@@ -454,18 +448,18 @@ describe("Trans component", () => {
454
448
} )
455
449
456
450
describe ( "I18nProvider defaultComponent accepts render-like props" , ( ) => {
457
- const DefaultComponent : React . FunctionComponent < TransRenderProps > = (
458
- props
459
- ) => (
460
- < >
461
- < div data-testid = "children " > { props . children } </ div >
462
- { props . id && < div data-testid = "id " > { props . id } </ div > }
463
- { props . message && < div data-testid = "message" > { props . message } </ div > }
464
- { props . translation && (
465
- < div data-testid = "translation" > { props . translation } </ div >
466
- ) }
467
- </ >
468
- )
451
+ function DefaultComponent ( props : TransRenderProps ) {
452
+ return (
453
+ < >
454
+ < div data-testid = "children" > { props . children } </ div >
455
+ { props . id && < div data-testid = "id " > { props . id } </ div > }
456
+ { props . message && < div data-testid = "message " > { props . message } </ div > }
457
+ { props . translation && (
458
+ < div data-testid = "translation" > { props . translation } </ div >
459
+ ) }
460
+ </ >
461
+ )
462
+ }
469
463
470
464
it ( "should render defaultComponent with Trans props" , ( ) => {
471
465
const markup = render (
0 commit comments