From d34b10db086d9a95919dde19535410c2765294b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Tammerg=C3=A5rd?= <44197016+filiptammergard@users.noreply.github.com> Date: Wed, 13 Apr 2022 23:30:53 +0200 Subject: [PATCH] feat: add info about change of typings in react 18 See https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210. Related to https://github.com/typescript-cheatsheets/react/issues/495. --- docs/basic/getting-started/basic-type-examples.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/basic/getting-started/basic-type-examples.md b/docs/basic/getting-started/basic-type-examples.md index e4063b04..80dc601e 100644 --- a/docs/basic/getting-started/basic-type-examples.md +++ b/docs/basic/getting-started/basic-type-examples.md @@ -94,6 +94,8 @@ function App() { This is because `ReactNode` includes `ReactFragment` which allows a `{}` type, which is [too wide](https://github.com/DefinitelyTyped/DefinitelyTyped/issues/37596#issue-480260937). Fixing this would break a lot of libraries, so for now you just have to be mindful that `ReactNode` is not absolutely bulletproof. [Thanks @pomle for raising this.](https://github.com/typescript-cheatsheets/react/issues/357) + +With the [React 18 type updates](https://github.com/DefinitelyTyped/DefinitelyTyped/pull/56210), `{}` is no longer allowed in `ReactFragment`.