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

OffcanvasHeader.d.ts is not aligned with propTypes #2798

Open
LukaszGrela opened this issue Apr 25, 2024 · 0 comments
Open

OffcanvasHeader.d.ts is not aligned with propTypes #2798

LukaszGrela opened this issue Apr 25, 2024 · 0 comments

Comments

@LukaszGrela
Copy link

LukaszGrela commented Apr 25, 2024

  • components: OffcanvasHeader
  • reactstrap version #x.x.x
  • import method es
  • react version #18.2.0
  • bootstrap version #5.3.3

What is happening?

I've noticed missing close prop on OffcanvasHeader. When looked at source code of the types and comparing with the propTypes in JS file noticed that also closeAriaLabel is missing from the types.

I've checked and the very same thing is with ModalHeader component.

This means that there is no hint provided:
image

What should be happening?

The type should contain missing props

// ~PropsWithChildren will add a children prop~ - actually HTMLAttributes handles that :)
export interface OffcanvasHeaderProps extends React.HTMLAttributes<HTMLElement> {
  [key: string]: any; // is it needed?
  tag?: React.ElementType;

  close?: React.ReactNode;
  closeAriaLabel?: string;

  cssModule?: CSSModule;
  wrapTag?: React.ElementType;
  toggle?: React.MouseEventHandler<any>;
}

hint should prompt with valid type
image

Steps to reproduce issue

Add in typescript code, try to type close property, expected hint will not appear.

Error message in console

None

Code

N/A

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

No branches or pull requests

1 participant