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

react-core type declarations contain bugs #10695

Open
allisonkarlitskaya opened this issue Jul 3, 2024 · 4 comments
Open

react-core type declarations contain bugs #10695

allisonkarlitskaya opened this issue Jul 3, 2024 · 4 comments
Labels
Milestone

Comments

@allisonkarlitskaya
Copy link

Quite simple: when we run tsc on our project we get a bunch of error output from the PatternFly type declarations:

node_modules/@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggleCheckbox.d.ts:4:18 - error TS2430: Interface 'MenuToggleCheckboxProps' incorrectly extends interface 'Omit<HTMLProps<HTMLInputElement>, "disabled" | "type" | "onChange" | "checked">'.
  Types of property 'defaultChecked' are incompatible.
    Type 'boolean | null' is not assignable to type 'boolean | undefined'.
      Type 'null' is not assignable to type 'boolean | undefined'.

4 export interface MenuToggleCheckboxProps extends Omit<React.HTMLProps<HTMLInputElement>, 'type' | 'onChange' | 'disabled' | 'checked'>, OUIAProps {
                   ~~~~~~~~~~~~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:4:35 - error TS2304: Cannot find name 'SVGIconProps'.

4     success: React.ComponentClass<SVGIconProps, any>;
                                    ~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:5:34 - error TS2304: Cannot find name 'SVGIconProps'.

5     danger: React.ComponentClass<SVGIconProps, any>;
                                   ~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:6:35 - error TS2304: Cannot find name 'SVGIconProps'.

6     warning: React.ComponentClass<SVGIconProps, any>;
                                    ~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:7:32 - error TS2304: Cannot find name 'SVGIconProps'.

7     info: React.ComponentClass<SVGIconProps, any>;
                                 ~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:8:34 - error TS2304: Cannot find name 'SVGIconProps'.

8     custom: React.ComponentClass<SVGIconProps, any>;
                                   ~~~~~~~~~~~~

node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/types.d.ts:118:34 - error TS2344: Type 'Options' does not satisfy the constraint 'Obj'.

118     fn: (arg0: ModifierArguments<Options>) => State | void;
                                     ~~~~~~~

  node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/types.d.ts:112:33
    112 export interface Modifier<Name, Options> {
                                        ~~~~~~~
    This type parameter might need an `extends Obj` constraint.

node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/types.d.ts:119:39 - error TS2344: Type 'Options' does not satisfy the constraint 'Obj'.

119     effect?: (arg0: ModifierArguments<Options>) => () => void | void;
                                          ~~~~~~~

  node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/types.d.ts:112:33
    112 export interface Modifier<Name, Options> {
                                        ~~~~~~~
    This type parameter might need an `extends Obj` constraint.


Found 8 errors in 3 files.

Errors  Files
     1  node_modules/@patternfly/react-core/dist/esm/components/MenuToggle/MenuToggleCheckbox.d.ts:4
     5  node_modules/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerListItemHeader.d.ts:4
     2  node_modules/@patternfly/react-core/dist/esm/helpers/Popper/thirdparty/popper-core/types.d.ts:118

We can't use skipLibCheck because we have .d.ts files in our own project that we want to check.

We're using "@patternfly/react-core": "5.3.3".

@tlabaj
Copy link
Contributor

tlabaj commented Aug 8, 2024

Do you have strict mode enabled?

@tlabaj tlabaj moved this from Needs triage to Needs info in PatternFly Issues Aug 8, 2024
@allisonkarlitskaya
Copy link
Author

Yes.

Copy link

github-actions bot commented Oct 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@allisonkarlitskaya
Copy link
Author

Needless to say, this isn't fixed yet, except now it's increased to 10 errors in 4 files...

@github-actions github-actions bot removed the wontfix label Oct 9, 2024
@kmcfaul kmcfaul removed the bug label Oct 25, 2024
@tlabaj tlabaj moved this from Needs info to Backlog in PatternFly Issues Nov 5, 2024
@tlabaj tlabaj added the PF5 label Nov 5, 2024
@tlabaj tlabaj added this to the 2024.Q4 milestone Nov 5, 2024
@tlabaj tlabaj moved this from Backlog to Ready to assign in PatternFly Issues Nov 19, 2024
@tlabaj tlabaj removed the status in PatternFly Issues Nov 19, 2024
@tlabaj tlabaj moved this to Ready to assign in PatternFly Issues Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Ready to assign
Development

No branches or pull requests

3 participants