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

Due to the type definition, UncontrolledAccordion cannot be used without toggle #2785

Open
haruhikonyan opened this issue Jan 11, 2024 · 1 comment

Comments

@haruhikonyan
Copy link

  • components: UncontrolledAccordion
  • reactstrap version #9.2.1
  • import method es
  • react version #18.2.0
  • bootstrap version #5.3.2

What is happening?

  • A type error occurs.

What should be happening?

I want to make it possible to use it without setting up props, like in the following URL.
https://reactstrap.github.io/?path=/docs/components-accordion--uncontrolled#uncontrolled

Steps to reproduce issue

  1. Render component without setting any props, like the following URL.

Error message in console

No overload matches this call.
  Overload 1 of 2, '(props: UncontrolledAccordionProps | Readonly<UncontrolledAccordionProps>): UncontrolledAccordion', gave the following error.
    Property 'toggle' is missing in type '{ children: Element; }' but required in type 'Readonly<UncontrolledAccordionProps>'.
  Overload 2 of 2, '(props: UncontrolledAccordionProps, context: any): UncontrolledAccordion', gave the following error.
    Property 'toggle' is missing in type '{ children: Element; }' but required in type 'Readonly<UncontrolledAccordionProps>'.ts(2769)
Accordion.d.ts(10, 3): 'toggle' is declared here.
Accordion.d.ts(10, 3): 'toggle' is declared here.

Code

Proposed Solution

export interface UncontrolledAccordionProps extends Omit<AccordionProps, 'open' | 'toggle'> {
@illiteratewriter
Copy link
Member

Hi, thank you for the issue. Would you like to make a PR for the same?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants