diff --git a/docs/basic/getting-started/function-components.md b/docs/basic/getting-started/function-components.md index 28e96632..659aedb0 100644 --- a/docs/basic/getting-started/function-components.md +++ b/docs/basic/getting-started/function-components.md @@ -55,9 +55,12 @@ const Title: React.FunctionComponent<{ title: string }> = ({ ```
-Using React.VoidFunctionComponent or React.VFC instead +(Deprecated)Using React.VoidFunctionComponent or React.VFC instead -As of [@types/react 16.9.48](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46643), you can also use `React.VoidFunctionComponent` or `React.VFC` type if you want to type `children` explicitly. This is an interim solution until `FunctionComponent` will accept no children by default (planned for `@types/react@^18.0.0`). +In [@types/react 16.9.48](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46643), the `React.VoidFunctionComponent` or `React.VFC` type was added for typing `children` explicitly. +However, please be aware that `React.VFC` and `React.VoidFunctionComponent` were deprecated in React 18 (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59882), so this interim solution is no longer necessary or recommended in React 18+. + + Please use regular function components or `React.VFC` instead. ```ts type Props = { foo: string };