From 16dd756feb6006db99d190f3ac2834ebd46564f5 Mon Sep 17 00:00:00 2001 From: sebastienlorber Date: Mon, 9 Oct 2023 15:16:02 +0200 Subject: [PATCH] use ReactDOM ErrorInfo type --- packages/docusaurus/src/client/clientEntry.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/docusaurus/src/client/clientEntry.tsx b/packages/docusaurus/src/client/clientEntry.tsx index 9407a06319cc..d6d4d365659e 100644 --- a/packages/docusaurus/src/client/clientEntry.tsx +++ b/packages/docusaurus/src/client/clientEntry.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import ReactDOM from 'react-dom/client'; +import ReactDOM, {type ErrorInfo} from 'react-dom/client'; import {BrowserRouter} from 'react-router-dom'; import {HelmetProvider} from 'react-helmet-async'; @@ -37,8 +37,12 @@ if (ExecutionEnvironment.canUseDOM) { ); - const onRecoverableError = (error: unknown, errorInfo: { digest?: string | null, componentStack?: string | null }): void => { - console.error('Docusaurus React Root onRecoverableError:', error, errorInfo); + const onRecoverableError = (error: unknown, errorInfo: ErrorInfo): void => { + console.error( + 'Docusaurus React Root onRecoverableError:', + error, + errorInfo, + ); }; const renderApp = () => {