Skip to content

Commit 39c042a

Browse files
committed
update react typings, React.ReactChildren was wrong
1 parent c0713b9 commit 39c042a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,10 @@ Notice we have used the TSDoc `/** comment */` style here on each prop. You can
467467
export declare interface AppProps {
468468
children1: JSX.Element; // bad, doesnt account for arrays
469469
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
471472
children: React.ReactNode; // best, accepts everything
473+
functionChildren: (name: string) => React.ReactNode; // recommended function as a child render prop type
472474
style?: React.CSSProperties; // to pass through style props
473475
onChange?: React.FormEventHandler<HTMLInputElement>; // form events! the generic parameter is the type of event.target
474476
props: Props & React.PropsWithoutRef<JSX.IntrinsicElements['button']>; // to impersonate all the props of a button element without its ref

0 commit comments

Comments
 (0)