From 2d3a4eaa5f7173728770a3afe87a7315cd61f78c Mon Sep 17 00:00:00 2001 From: Ash Date: Wed, 18 Sep 2024 14:43:09 +0100 Subject: [PATCH] chore(sanity): add return type to `StudioErrorBoundary` component --- packages/sanity/src/core/studio/StudioErrorBoundary.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/sanity/src/core/studio/StudioErrorBoundary.tsx b/packages/sanity/src/core/studio/StudioErrorBoundary.tsx index b82524c5422a..18e0c2401d5f 100644 --- a/packages/sanity/src/core/studio/StudioErrorBoundary.tsx +++ b/packages/sanity/src/core/studio/StudioErrorBoundary.tsx @@ -9,7 +9,7 @@ import { Heading, Stack, } from '@sanity/ui' -import {type ErrorInfo, type ReactNode, useCallback, useState} from 'react' +import {type ComponentType, type ErrorInfo, type ReactNode, useCallback, useState} from 'react' import {useHotModuleReload} from 'use-hot-module-reload' import {Button} from '../../ui-components' @@ -42,10 +42,10 @@ const INITIAL_STATE = { eventId: null, } satisfies ErrorBoundaryState -export function StudioErrorBoundary({ +export const StudioErrorBoundary: ComponentType = ({ children, heading = 'An error occured', -}: StudioErrorBoundaryProps) { +}) => { const [{error, eventId}, setError] = useState(INITIAL_STATE) const message = isRecord(error) && typeof error.message === 'string' && error.message