Skip to content

Commit

Permalink
feat(Modal): split modal types for ease of export (#13)
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 831a86f commit 9ea30fa
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 @@ -47,7 +47,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 @@ -75,7 +80,9 @@ export interface ModalProps extends TransitionCallbacks {
restoreFocusOptions?: {
preventScroll: boolean;
};
}

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

Expand Down

0 comments on commit 9ea30fa

Please sign in to comment.