From 44ee9d462637d2dc00696f6768335f6246ba6980 Mon Sep 17 00:00:00 2001 From: Emil Kowalski Date: Wed, 15 Jan 2025 02:41:13 +0100 Subject: [PATCH] fix next error --- src/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index dbcca73..19cdfe1 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1,6 +1,6 @@ 'use client'; -import React, { forwardRef } from 'react'; +import React, { forwardRef, isValidElement } from 'react'; import ReactDOM from 'react-dom'; import { CloseIcon, getAsset, Loader } from './assets'; @@ -354,7 +354,7 @@ const Toast = (props: ToastProps) => { ) : null} {/* TODO: This can be cleaner */} - {toast.jsx || React.isValidElement(toast.title) ? ( + {toast.jsx || isValidElement(toast.title) ? ( toast.jsx ? ( toast.jsx ) : typeof toast.title === 'function' ? ( @@ -389,7 +389,7 @@ const Toast = (props: ToastProps) => { ) : null} - {React.isValidElement(toast.cancel) ? ( + {isValidElement(toast.cancel) ? ( toast.cancel ) : toast.cancel && isAction(toast.cancel) ? ( ) : null} - {React.isValidElement(toast.action) ? ( + {isValidElement(toast.action) ? ( toast.action ) : toast.action && isAction(toast.action) ? (