Skip to content

Breaking change from @types/react@18 #6062

@kristofferaas

Description

@kristofferaas

@types/react@18 removed implicit children prop from type React.FC, from now on children should now be explicitly defined.
DefinitelyTyped/DefinitelyTyped#56210

From a quick exploration; extending BoxExtendedProps instead of BoxProps on affected components should resolve the issue :)

Expected behaviour

Allowed to pass children props when using React 18 and TypeScript.

Current behaviour

TypeScript complains that Property 'children' does not exist on type X.

https://codesandbox.io/s/fragrant-waterfall-6921n6?file=/src/App.tsx

Steps to Reproduce

Create a new project with React 18, @types/react@18 and TypeScript.

Your Environment

  • Grommet version: 2.22.0
  • Browser Name and version:
  • Operating System and version (desktop or mobile):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions