FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

PF4: Modal onClose callbacked changed to () => void; in @patternfly/react-core 3.16.4 and prior it allowed passing an argument · Issue #2233 · patternfly/patternfly-react · GitHub

PF4: Modal onClose callbacked changed to () => void; in @patternfly/react-core 3.16.4 and prior it allowed passing an argument  #2233

Description

We noticed a breaking change in typedef for 'onClose?: () => void;' of Modal.tsx
https://github.com/patternfly/patternfly-react/blob/master/packages/patternfly-4/react-core/src/components/Modal/Modal.tsx#L27

We were using "@patternfly/react-core": "3.16.4" , attempted to upgrade to latest and hit error:
ERROR in /git/fusor/mig-ui/src/app/common/components/ConfirmModal.tsx
./src/app/common/components/ConfirmModal.tsx
[tsl] ERROR in /git/fusor/mig-ui/src/app/common/components/ConfirmModal.tsx(20,7)
TS2322: Type '(isConfirmed: any) => void' is not assignable to type '() => void'.

Resolve by pinning to "@patternfly/react-core": "3.16.4"

Our example:
https://github.com/fusor/mig-ui/blob/master/src/app/home/components/DataList/Clusters/ClusterDataListItem.tsx#L42
https://github.com/fusor/mig-ui/blob/master/src/app/common/components/ConfirmModal.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL