In React, a "React node" is a value that can be returned from a component's render or used as children, and contains more values than just ReactElement.
Now that Dart has type aliases (in SDK 2.13 and up), can name this type so that consumers can be more expressive in how they type their code (and also to help them avoid using ReactElement, which in some cases is overly restrictive).
Changes
Add ReactNode typedef, which is an alias for Object?.
Motivation
In React, a "React node" is a value that can be returned from a component's render or used as children, and contains more values than just
ReactElement
.TypeScript captures this type as a
ReactNode
typeNow that Dart has type aliases (in SDK 2.13 and up), can name this type so that consumers can be more expressive in how they type their code (and also to help them avoid using
ReactElement
, which in some cases is overly restrictive).Changes
ReactNode
typedef, which is an alias forObject?
.