Skip to content

Commit

Permalink
feat(Modal): split modal types for ease of export (#956)
Browse files Browse the repository at this point in the history
* feat: split modal types for ease of export

* replaced type with interface

* change interface naming
  • Loading branch information
golota60 authored Jun 23, 2021
1 parent 1c8688d commit 849ab56
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export interface RenderModalBackdropProps {
ref: React.RefCallback<Element>;
onClick: (event: React.SyntheticEvent) => void;
}
export interface ModalProps extends TransitionCallbacks {

/*
Modal props are split into a version with and without index signature so that you can fully use them in another projects
This is due to Typescript not playing well with index singatures e.g. when using Omit
*/
export interface BaseModalProps extends TransitionCallbacks {
children?: React.ReactElement;
role?: string;
style?: React.CSSProperties;
Expand Down Expand Up @@ -74,7 +79,9 @@ export interface ModalProps extends TransitionCallbacks {
restoreFocusOptions?: {
preventScroll: boolean;
};
}

export interface ModalProps extends BaseModalProps {
[other: string]: any;
}

Expand Down

0 comments on commit 849ab56

Please sign in to comment.