From 076f42acef1fb82918b47a173fba1077e0533e04 Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Thu, 26 Dec 2024 20:10:47 +0100 Subject: [PATCH] fix: workaround error `Cannot find namespace JSX` --- packages/vike-react/src/integration/getPageElement.tsx | 2 +- packages/vike-react/src/types/PageContext.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/vike-react/src/integration/getPageElement.tsx b/packages/vike-react/src/integration/getPageElement.tsx index a8ef4048..18f83361 100644 --- a/packages/vike-react/src/integration/getPageElement.tsx +++ b/packages/vike-react/src/integration/getPageElement.tsx @@ -4,7 +4,7 @@ import React, { Suspense, useEffect } from 'react' import type { PageContext } from 'vike/types' import { PageContextProvider } from '../hooks/usePageContext.js' -function getPageElement(pageContext: PageContext): { page: JSX.Element; renderPromise: Promise } { +function getPageElement(pageContext: PageContext): { page: React.JSX.Element; renderPromise: Promise } { const { Page, config: { Loading }, diff --git a/packages/vike-react/src/types/PageContext.ts b/packages/vike-react/src/types/PageContext.ts index b636ef25..2107c72b 100644 --- a/packages/vike-react/src/types/PageContext.ts +++ b/packages/vike-react/src/types/PageContext.ts @@ -1,5 +1,4 @@ import type React from 'react' -import type { JSX } from 'react' import type ReactDOM from 'react-dom/client' import type { ConfigFromHookResolved } from './Config.js' import type { PageHtmlStream } from '../integration/onRenderHtml.js' @@ -11,7 +10,7 @@ declare global { /** The root React component of the page */ Page?: () => React.ReactNode /** The root React element of the page */ - page?: JSX.Element + page?: React.JSX.Element /** The React root DOM container */ root?: ReactDOM.Root