Skip to content

Commit

Permalink
fix(core): fix typing-issues related to GlobalDocumentReferenceInput
Browse files Browse the repository at this point in the history
  • Loading branch information
skogsmaskin committed Jan 30, 2025
1 parent b77e987 commit 293a6b8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {Box, Card, Flex, Inline, Menu, Stack, useClickOutsideEvent, useToast} fr
import {
type FocusEvent,
type KeyboardEvent,
type ReactNode,
useCallback,
useId,
useMemo,
Expand Down Expand Up @@ -56,9 +57,7 @@ const NO_FILTER = () => true
const REF_PATH = ['_ref']

/** @internal */
export function GlobalDocumentReferenceInput(
props: GlobalDocumentReferenceInputProps,
): JSX.Element {
export function GlobalDocumentReferenceInput(props: GlobalDocumentReferenceInputProps): ReactNode {
const {
changed,
focused,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function GlobalDocumentReferencePreview(props: {
resourceId: string
refType?: GlobalDocumentReferenceType
showTypeLabel: boolean
}): JSX.Element {
}): React.JSX.Element {
const {
refType,
showStudioUrlIcon,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {type GlobalDocumentReferenceSchemaType} from '@sanity/types'
import {Stack, Text, TextSkeleton} from '@sanity/ui'
import {type ReactNode} from 'react'
import {type Observable} from 'rxjs'

import {useTranslation} from '../../../i18n'
Expand All @@ -19,7 +20,7 @@ export function OptionPreview(props: {
document: {_id: string; _type: string}
referenceType: GlobalDocumentReferenceSchemaType
getReferenceInfo: (doc: {_id: string; _type?: string}) => Observable<GlobalDocumentReferenceInfo>
}): JSX.Element | null {
}): ReactNode {
const {
isLoading,
result: referenceInfo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function PreviewReferenceValue(props: {
hasStudioUrl?: boolean
type: GlobalDocumentReferenceSchemaType
referenceInfo: Loadable<GlobalDocumentReferenceInfo>
}): JSX.Element {
}): React.JSX.Element {
const {value, type, showStudioUrlIcon, hasStudioUrl, referenceInfo} = props
const {t} = useTranslation()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ReferenceAutocomplete = forwardRef(function ReferenceAutocomplete(
props: ComponentProps<typeof Autocomplete> & {
referenceElement: HTMLDivElement | null
searchString?: string
portalRef?: RefObject<HTMLDivElement>
portalRef?: RefObject<HTMLDivElement | null>
},
ref: ForwardedRef<HTMLInputElement>,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type SearchError = {
*/
export function StudioGlobalDocumentReferenceInput(
props: StudioGlobalDocumentReferenceInputProps,
): JSX.Element {
): React.JSX.Element {
const {path, schemaType} = props
const source = useSource()
const client = source.getClient({
Expand Down

0 comments on commit 293a6b8

Please sign in to comment.