File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -467,8 +467,10 @@ Notice we have used the TSDoc `/** comment */` style here on each prop. You can
467
467
export declare interface AppProps {
468
468
children1: JSX .Element ; // bad, doesnt account for arrays
469
469
children2: JSX .Element | JSX .Element []; // meh, doesnt accept functions
470
- children3: React .ReactChild | React .ReactChildren ; // better, but doesnt accept strings
470
+ children3: React .ReactChildren ; // despite the name, not at all an appropriate type; it is a utility
471
+ children3: React .ReactChild []; // better
471
472
children: React .ReactNode ; // best, accepts everything
473
+ functionChildren: (name : string ) => React .ReactNode ; // recommended function as a child render prop type
472
474
style? : React .CSSProperties ; // to pass through style props
473
475
onChange? : React .FormEventHandler <HTMLInputElement >; // form events! the generic parameter is the type of event.target
474
476
props: Props & React .PropsWithoutRef <JSX .IntrinsicElements [' button' ]>; // to impersonate all the props of a button element without its ref
You can’t perform that action at this time.
0 commit comments