Skip to content

JSX type errors on React Bootstrap 2.x & Preact 10.x #4425

@TechQuery

Description

@TechQuery
  • Check if updating to the latest Preact version resolves the issue

Describe the bug

Every React Bootstrap component with Preact has a similar error as shown below:

'Container' cannot be used as a JSX component.
  Its type 'BsPrefixRefForwardingComponent<"div", ContainerProps>' is not a valid JSX element type.
    Type 'BsPrefixRefForwardingComponent<"div", ContainerProps>' is not assignable to type 'FunctionComponent<any>'.
      Type 'ComponentChild' is not assignable to type 'VNode<any>'.
        Type 'string' is not assignable to type 'VNode<any>'.ts(2786)

To Reproduce

Steps to reproduce the behavior

  1. git clone https://github.com/idea2app/React-MobX-Bootstrap-ts
  2. npm i
  3. npx tsc --noEmit

Expected behavior

No type errors as React does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions