Skip to content

Commit

Permalink
fix(notifications): fix type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Jun 6, 2022
1 parent f91c5c5 commit d22a0b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/notifications/src/Portal/Portal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type PortalNotificationConfig = {

export interface PortalProps {
notifications?: PortalNotificationConfig[];
removeNotification: (id: number | string) => void;
removeNotification?: (id: number | string) => void;
onClearAll?: () => void;
rootId?: string;
}
Expand All @@ -26,7 +26,7 @@ type PortalState = {
page: number;
};

const Portal: React.ComponentType<PortalProps> = ({ notifications = [], removeNotification, rootId, onClearAll }) => {
const Portal: React.ComponentType<PortalProps> = ({ notifications = [], removeNotification = () => undefined, rootId, onClearAll }) => {
const [state, setState] = useState<PortalState>({ page: 1 });

const onSetPage = (_event: React.MouseEvent | React.KeyboardEvent | MouseEvent, page: number) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type CreateNotificationsMiddlewareOptions = {
errorNamespaceKey?: string | string[];
};

export const createNotificationsMiddleware = (options: CreateNotificationsMiddlewareOptions) => {
export const createNotificationsMiddleware = (options?: CreateNotificationsMiddlewareOptions) => {
const defaultOptions: CreateNotificationsMiddlewareOptions = {
dispatchDefaultFailure: true,
pendingSuffix: '_PENDING',
Expand Down

0 comments on commit d22a0b5

Please sign in to comment.