From 63a62539bbb9e561939fb76c1d90112dc8d92bc6 Mon Sep 17 00:00:00 2001 From: Egor Didenko Date: Tue, 11 Jun 2024 13:12:46 -0400 Subject: [PATCH] fix(suspense): Fixed the implementation to apiRef. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now apiRef works. Note: 1. When using Next.js you need to specify “use-client” 2. In Next.js should solve issues with hydration and SSR support via React Uploader --- .../ConditionalSuspense.tsx | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/react-uploader/src/SSR/ConditionalSuspense/ConditionalSuspense.tsx b/packages/react-uploader/src/SSR/ConditionalSuspense/ConditionalSuspense.tsx index ff57b32..4ee86f3 100644 --- a/packages/react-uploader/src/SSR/ConditionalSuspense/ConditionalSuspense.tsx +++ b/packages/react-uploader/src/SSR/ConditionalSuspense/ConditionalSuspense.tsx @@ -1,17 +1,15 @@ -import React, { FC, Suspense } from 'react'; +import React, { FC, Suspense } from "react"; export type TProps = { - fallback?: React.ReactChild | React.ReactFragment | React.ReactPortal | null; - condition: boolean; - children: React.ReactNode; + // fallback?: React.ReactChild | React.ReactFragment | React.ReactPortal | null; + // condition: boolean; + children: React.ReactNode; }; -export const ConditionalSuspense: FC = ({ condition, fallback, children, ...rest }) => { - return condition ? ( - - {children} - - ) : ( - <>{fallback} - ); -}; \ No newline at end of file +export const ConditionalSuspense: FC = ({ + // condition, + // fallback, + children, +}) => { + return children; +};