Skip to content

Commit b7b677c

Browse files
committed
chore(sanity): add return type to StudioErrorBoundary component
1 parent 714b3e1 commit b7b677c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/sanity/src/core/studio/StudioErrorBoundary.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
Heading,
1010
Stack,
1111
} from '@sanity/ui'
12-
import {type ErrorInfo, type ReactNode, useCallback, useState} from 'react'
12+
import {type ComponentType, type ErrorInfo, type ReactNode, useCallback, useState} from 'react'
1313
import {useHotModuleReload} from 'use-hot-module-reload'
1414

1515
import {Button} from '../../ui-components'
@@ -42,10 +42,10 @@ const INITIAL_STATE = {
4242
eventId: null,
4343
} satisfies ErrorBoundaryState
4444

45-
export function StudioErrorBoundary({
45+
export const StudioErrorBoundary: ComponentType<StudioErrorBoundaryProps> = ({
4646
children,
4747
heading = 'An error occured',
48-
}: StudioErrorBoundaryProps) {
48+
}) => {
4949
const [{error, eventId}, setError] = useState<ErrorBoundaryState>(INITIAL_STATE)
5050

5151
const message = isRecord(error) && typeof error.message === 'string' && error.message

0 commit comments

Comments
 (0)