Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopoverProps Incompatible with New React Typings on v1.6.6 (Bootstrap 4) #6611

Closed
3 tasks done
hueter opened this issue Apr 27, 2023 · 0 comments · Fixed by #6612
Closed
3 tasks done

PopoverProps Incompatible with New React Typings on v1.6.6 (Bootstrap 4) #6611

hueter opened this issue Apr 27, 2023 · 0 comments · Fixed by #6612
Labels

Comments

@hueter
Copy link
Contributor

hueter commented Apr 27, 2023

Prerequisites

Describe the bug

Hello,

I'm still on Bootstrap 4 so I'm using 1.6.6, and after upgrading React typings recently I ran into this error coming from React Bootstrap's Popover typings:

error TS2430: Interface 'PopoverProps' incorrectly extends interface 'Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">'.
  Types of property 'content' are incompatible.
    Type 'boolean | undefined' is not assignable to type 'string | undefined'.
      Type 'boolean' is not assignable to type 'string'.

6 export interface PopoverProps extends React.ComponentPropsWithoutRef<'div'>, BsPrefixPropsWithChildren {
                   ~~~~~~~~~~~~


Found 1 error in node_modules/react-bootstrap/esm/Popover.d.ts:6

I think this line just needs to be updated from boolean to string, but I'm not sure because I don't even see this line on the main branch anymore:

content?: boolean;

Expected behavior

No errors when compiling types

To Reproduce

  1. Clone the example repo
  2. Run npm install && npx tsc --noEmit

Reproducible Example

https://github.com/hueter/react-bootstrap-typings-bug/tree/main

Screenshots

Screenshot 2023-04-26 at 8 31 37 PM

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

No response

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

No response

What version of React-Bootstrap are you using?

1.6.6

What version of Bootstrap are you using?

4.6.2

Additional context

{
  "dependencies": {
    "@types/react": "^18.2.0",
    "@types/react-dom": "^18.2.1",
    "bootstrap": "4.6.2",
    "react": "^18.2.0",
    "react-bootstrap": "1.6.6",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.9.5"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants