From 9562a4b22babcf1f6c26e6937d92dba2b5b2b49e Mon Sep 17 00:00:00 2001 From: Ben Hodgson Date: Tue, 13 Nov 2018 12:14:03 +0000 Subject: [PATCH 1/2] Fix "TS2304: Cannot find name 'ToastType'." error in TS definitions --- src/definitions.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions.d.ts b/src/definitions.d.ts index ad3a8c5..3b8041d 100644 --- a/src/definitions.d.ts +++ b/src/definitions.d.ts @@ -1,5 +1,5 @@ import React from 'react'; -import {ToastType, ToastContainerProps as ReactToastContainerProps} from "react-toastify"; +import {ToastContainerProps as ReactToastContainerProps} from "react-toastify"; import {ComponentClass, SFC} from "react"; export interface ToastBaseOptions { @@ -20,7 +20,7 @@ export interface ToastBaseOptions { * Set the toast type. * `One of: 'info', 'success', 'warning', 'error', 'default'` */ - type?: ToastType; + type?: 'info' | 'success' | 'warning' | 'error' | 'default'; /** * Pause the timer when the mouse hover the toast. From b62f753cb27cf9ea00c373561bffcfc4d5ef7e7e Mon Sep 17 00:00:00 2001 From: Ben Hodgson Date: Tue, 13 Nov 2018 12:22:39 +0000 Subject: [PATCH 2/2] Message should not be required when updating a toast --- src/definitions.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions.d.ts b/src/definitions.d.ts index 3b8041d..d04f24c 100644 --- a/src/definitions.d.ts +++ b/src/definitions.d.ts @@ -152,7 +152,7 @@ export interface DismissActionPayload { * Update action options */ export interface UpdateActionOptions extends ToastBaseOptions { - message: any; + message?: any; } /**