Skip to content

Commit

Permalink
chore(sanity): add return type to StudioErrorBoundary component
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Sep 18, 2024
1 parent 5a305c9 commit 2d3a4ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/sanity/src/core/studio/StudioErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -42,10 +42,10 @@ const INITIAL_STATE = {
eventId: null,
} satisfies ErrorBoundaryState

export function StudioErrorBoundary({
export const StudioErrorBoundary: ComponentType<StudioErrorBoundaryProps> = ({
children,
heading = 'An error occured',
}: StudioErrorBoundaryProps) {
}) => {
const [{error, eventId}, setError] = useState<ErrorBoundaryState>(INITIAL_STATE)

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

0 comments on commit 2d3a4ea

Please sign in to comment.