Skip to content

Commit e6f3934

Browse files
Updated README on 2022-04-19T22:14:07.916Z
1 parent 667d53c commit e6f3934

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/basic/getting-started/function-components.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ Some differences from the "normal function" version:
4545

4646
- Note that there are some known issues using `defaultProps` with `React.FunctionComponent`. See [this issue for details](https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/issues/87). We maintain a separate `defaultProps` section you can also look up.
4747

48-
- It provides an implicit definition of `children` (see below) - however there are some issues with the implicit `children` type (e.g. [DefinitelyTyped#33006](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33006)), and it might be better to be explicit about components that consume `children`, anyway. With the [React 18 type updates](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210), `children` is no longer implicitly defined.
48+
- Before the [React 18 type updates](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210), `React.FunctionComponent` provided an implicit definition of `children` (see below), which was heavily debated and is one of the reasons [`React.FC` was removed from the Create React App TypeScript template](https://github.com/facebook/create-react-app/pull/8177).
4949

5050
```tsx
51+
// before React 18 types
5152
const Title: React.FunctionComponent<{ title: string }> = ({
5253
children,
5354
title,

0 commit comments

Comments
 (0)