10000 TS2786: '<Any Bootstrap Component>' cannot be used as a JSX component. · Issue #6819 · react-bootstrap/react-bootstrap · GitHub
[go: up one dir, main page]

Skip to content
TS2786: '<Any Bootstrap Component>' cannot be used as a JSX component. #6819
Closed
@jonathan-meyer

Description

@jonathan-meyer

Prerequisites

Describe the bug

v2.10.3 of react-boostrap does not work with Typescript. Every react-bootstrap component throws a TS2796 error when compiled.

Expected behavior

it should compile with out errors.

To Reproduce

  1. create a project with npx create-react-app my-app --template typescript
  2. add react-bootstrap npm add bootstrap react-bootstrap
  3. use a react-bootstrap component.
import { Alert, Container } from "react-bootstrap";
import "./App.css";

function App() {
  return (
    <Container>
      <Alert>Hello World</Alert>
    </Container>
  );
}

export default App;
  1. run npm run start

image

Reproducible Example

Codesandbox Example

Screenshots

v2.10.3 is broken.
image
v2.10.2 works fine!
image

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome

What version of React-Bootstrap are you using?

2.10.3

What version of Bootstrap are you using?

5.3.3

Additional context

No response

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

      0