diff --git a/dev/embedded-studio/package.json b/dev/embedded-studio/package.json index 2fe7e022945..33d1039c11f 100644 --- a/dev/embedded-studio/package.json +++ b/dev/embedded-studio/package.json @@ -15,8 +15,8 @@ "styled-components": "^6.1.0" }, "devDependencies": { - "@types/react": "^18.3.18", - "@types/react-dom": "^18.3.5", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", "@vitejs/plugin-react": "^4.3.4", "typescript": "5.7.2", "vite": "^5.4.11" diff --git a/dev/test-next-studio/app/registry.tsx b/dev/test-next-studio/app/registry.tsx index 0306d343e96..e666225e5be 100644 --- a/dev/test-next-studio/app/registry.tsx +++ b/dev/test-next-studio/app/registry.tsx @@ -6,7 +6,11 @@ import {useServerInsertedHTML} from 'next/navigation' import {useState, useSyncExternalStore} from 'react' import {ServerStyleSheet, StyleSheetManager} from 'styled-components' -export function StyledComponentsRegistry({children}: {children: React.ReactNode}): JSX.Element { +export function StyledComponentsRegistry({ + children, +}: { + children: React.ReactNode +}): React.JSX.Element { const isMounted = useSyncExternalStore( emptySubscribe, () => true, diff --git a/dev/test-studio/preview/FieldGroups.tsx b/dev/test-studio/preview/FieldGroups.tsx index bca2af357cb..7b675ca722a 100644 --- a/dev/test-studio/preview/FieldGroups.tsx +++ b/dev/test-studio/preview/FieldGroups.tsx @@ -2,7 +2,7 @@ import {Box, Card, Stack, Text} from '@sanity/ui' import {useQuery} from './loader' -export function FieldGroups(): JSX.Element { +export function FieldGroups(): React.JSX.Element { const {data, loading, error} = useQuery< { _id: string diff --git a/dev/test-studio/preview/SimpleBlockPortableText.tsx b/dev/test-studio/preview/SimpleBlockPortableText.tsx index 9a6339ae15e..4cd27549f65 100644 --- a/dev/test-studio/preview/SimpleBlockPortableText.tsx +++ b/dev/test-studio/preview/SimpleBlockPortableText.tsx @@ -19,7 +19,7 @@ const components: PortableTextComponents = { }, } -export function SimpleBlockPortableText(): JSX.Element { +export function SimpleBlockPortableText(): React.JSX.Element { const {data, loading, error} = useQuery< { _id: string diff --git a/package.json b/package.json index 1704a428d15..d98da98ec25 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "@types/glob": "^7.2.0", "@types/lodash": "^4.17.7", "@types/node": "^22.10.0", - "@types/react": "^18.3.12", + "@types/react": "^19.0.2", "@types/semver": "^7.5.6", "@types/yargs": "^17.0.7", "@typescript-eslint/eslint-plugin": "^7.18.0", diff --git a/packages/@sanity/block-tools/package.json b/packages/@sanity/block-tools/package.json index a4665e30847..6cf0c0910f8 100644 --- a/packages/@sanity/block-tools/package.json +++ b/packages/@sanity/block-tools/package.json @@ -50,7 +50,6 @@ }, "dependencies": { "@sanity/types": "3.68.3", - "@types/react": "^18.3.5", "get-random-values-esm": "1.0.2", "lodash": "^4.17.21" }, @@ -60,11 +59,15 @@ "@sanity/schema": "3.68.3", "@types/jsdom": "^20.0.0", "@types/lodash": "^4.17.7", + "@types/react": "^19.0.2", "@vercel/stega": "0.1.2", "@vitest/coverage-v8": "^2.1.1", "jsdom": "^23.0.1", "vitest": "^2.1.8" }, + "peerDependencies": { + "@types/react": "18 || 19" + }, "publishConfig": { "access": "public" } diff --git a/packages/@sanity/cli/test/test-template/package.json b/packages/@sanity/cli/test/test-template/package.json index 2fe7ae50df1..104269ababe 100644 --- a/packages/@sanity/cli/test/test-template/package.json +++ b/packages/@sanity/cli/test/test-template/package.json @@ -20,8 +20,8 @@ "@sanity/vision": "^3.62.0", "@tailwindcss/typography": "^0.5.15", "@types/node": "^22.7.8", - "@types/react": "^18.3.11", - "@types/react-dom": "^18.3.1", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", "@vercel/speed-insights": "^1.0.13", "autoprefixer": "^10.4.20", "date-fns": "^4.1.0", diff --git a/packages/@sanity/schema/package.json b/packages/@sanity/schema/package.json index 06426eaa9d9..d8cd2a165d8 100644 --- a/packages/@sanity/schema/package.json +++ b/packages/@sanity/schema/package.json @@ -78,7 +78,7 @@ "@sanity/icons": "^3.5.7", "@types/lodash": "^4.17.7", "@types/object-inspect": "^1.13.0", - "@types/react": "^18.3.12", + "@types/react": "^19.0.2", "rimraf": "^5.0.10", "vitest": "^2.1.8" } diff --git a/packages/@sanity/types/package.json b/packages/@sanity/types/package.json index 05de0cdccb8..8566a7069a8 100644 --- a/packages/@sanity/types/package.json +++ b/packages/@sanity/types/package.json @@ -55,7 +55,7 @@ "@repo/package.config": "workspace:*", "@repo/test-config": "workspace:*", "@sanity/insert-menu": "1.0.18", - "@types/react": "^18.3.5", + "@types/react": "^19.0.2", "@vitejs/plugin-react": "^4.3.4", "react": "^18.3.1", "rimraf": "^5.0.10", diff --git a/packages/@sanity/types/src/schema/definition/type/common.ts b/packages/@sanity/types/src/schema/definition/type/common.ts index b970f82e3fe..2bdb5ceaa12 100644 --- a/packages/@sanity/types/src/schema/definition/type/common.ts +++ b/packages/@sanity/types/src/schema/definition/type/common.ts @@ -55,7 +55,7 @@ export interface BaseSchemaTypeOptions { export interface BaseSchemaDefinition { name: string title?: string - description?: string | ReactElement + description?: string | ReactElement hidden?: ConditionalProperty readOnly?: ConditionalProperty icon?: ComponentType | ReactNode diff --git a/packages/@sanity/vision/src/components/ResultView.tsx b/packages/@sanity/vision/src/components/ResultView.tsx index 48d76d9ac71..7a7c15b0f49 100644 --- a/packages/@sanity/vision/src/components/ResultView.tsx +++ b/packages/@sanity/vision/src/components/ResultView.tsx @@ -9,7 +9,7 @@ import {ResultViewWrapper} from './ResultView.styled' const lru = new LRU({maxSize: 50000}) -export function ResultView(props: {data: unknown; datasetName: string}): JSX.Element { +export function ResultView(props: {data: unknown; datasetName: string}): React.JSX.Element { const {data, datasetName} = props const workspaceDataset = useDataset() diff --git a/packages/@sanity/vision/src/components/VisionGui.tsx b/packages/@sanity/vision/src/components/VisionGui.tsx index c26e5c885b3..11823bfb8b6 100644 --- a/packages/@sanity/vision/src/components/VisionGui.tsx +++ b/packages/@sanity/vision/src/components/VisionGui.tsx @@ -151,11 +151,11 @@ interface VisionGuiState { } export class VisionGui extends PureComponent { - _visionRoot: RefObject - _queryEditorContainer: RefObject - _paramsEditorContainer: RefObject - _operationUrlElement: RefObject - _customApiVersionElement: RefObject + _visionRoot: RefObject + _queryEditorContainer: RefObject + _paramsEditorContainer: RefObject + _operationUrlElement: RefObject + _customApiVersionElement: RefObject _resizeListener: ResizeObserver | undefined _querySubscription: Subscription | undefined _listenSubscription: Subscription | undefined diff --git a/packages/sanity/package.json b/packages/sanity/package.json index 00189bde1bc..878be30e25f 100644 --- a/packages/sanity/package.json +++ b/packages/sanity/package.json @@ -183,7 +183,7 @@ "@sentry/react": "^8.33.0", "@tanstack/react-table": "^8.16.0", "@tanstack/react-virtual": "^3.11.2", - "@types/react-is": "^18.3.0", + "@types/react-is": "^19.0.0", "@types/shallow-equals": "^1.0.0", "@types/speakingurl": "^13.0.3", "@types/tar-stream": "^3.1.3", @@ -288,8 +288,8 @@ "@types/log-symbols": "^2.0.0", "@types/node": "^22.10.0", "@types/raf": "^3.4.0", - "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", "@types/refractor": "^3.0.0", "@types/resolve-from": "^4.0.0", "@types/semver": "^6.2.3", diff --git a/packages/sanity/playwright-ct/tests/formBuilder/tree-editing/TreeEditingStory.tsx b/packages/sanity/playwright-ct/tests/formBuilder/tree-editing/TreeEditingStory.tsx index c1262ccdfb1..6158f5f79ba 100644 --- a/packages/sanity/playwright-ct/tests/formBuilder/tree-editing/TreeEditingStory.tsx +++ b/packages/sanity/playwright-ct/tests/formBuilder/tree-editing/TreeEditingStory.tsx @@ -162,7 +162,7 @@ interface TreeEditingStoryProps { value?: SanityDocument } -export function TreeEditingStory(props: TreeEditingStoryProps): JSX.Element { +export function TreeEditingStory(props: TreeEditingStoryProps): React.JSX.Element { const {legacyEditing, openPath, value} = props const types = getSchemaTypes({legacyEditing}) diff --git a/packages/sanity/playwright-ct/tests/formBuilder/utils/TestWrapper.tsx b/packages/sanity/playwright-ct/tests/formBuilder/utils/TestWrapper.tsx index 69f98a55a1c..334e65e1ceb 100644 --- a/packages/sanity/playwright-ct/tests/formBuilder/utils/TestWrapper.tsx +++ b/packages/sanity/playwright-ct/tests/formBuilder/utils/TestWrapper.tsx @@ -40,7 +40,7 @@ const StyledChangeConnectorRoot = styled(ChangeConnectorRoot)` * @description This component is used to wrap all tests in the providers it needs to be able to run successfully. * It provides a mock Sanity client and a mock workspace. */ -export const TestWrapper = (props: TestWrapperProps): JSX.Element | null => { +export const TestWrapper = (props: TestWrapperProps): React.JSX.Element | null => { const {children, schemaTypes, betaFeatures} = props const [mockWorkspace, setMockWorkspace] = useState(null) diff --git a/packages/sanity/src/_internal/manifest/Icon.tsx b/packages/sanity/src/_internal/manifest/Icon.tsx index a0b087ab4e6..e36e99e1faa 100644 --- a/packages/sanity/src/_internal/manifest/Icon.tsx +++ b/packages/sanity/src/_internal/manifest/Icon.tsx @@ -12,7 +12,7 @@ interface SchemaIconProps { subtitle?: string } -const SchemaIcon = ({icon, title, subtitle}: SchemaIconProps): JSX.Element => { +const SchemaIcon = ({icon, title, subtitle}: SchemaIconProps): React.JSX.Element => { return {normalizeIcon(icon, title, subtitle)} } @@ -20,7 +20,7 @@ function normalizeIcon( Icon: ComponentType | ReactNode | undefined, title: string, subtitle = '', -): JSX.Element { +): React.JSX.Element { if (isValidElementType(Icon)) return if (isValidElement(Icon)) return Icon return createDefaultIcon(title, subtitle) diff --git a/packages/sanity/src/core/comments/__workshop__/CommentsMessageURLSerializerStory.tsx b/packages/sanity/src/core/comments/__workshop__/CommentsMessageURLSerializerStory.tsx index e7561d7c8e6..524735d40dc 100644 --- a/packages/sanity/src/core/comments/__workshop__/CommentsMessageURLSerializerStory.tsx +++ b/packages/sanity/src/core/comments/__workshop__/CommentsMessageURLSerializerStory.tsx @@ -40,7 +40,7 @@ const BLOCKS: CommentMessage = [ }, ] -export default function CommentsMessageURLSerializerStory(): JSX.Element { +export default function CommentsMessageURLSerializerStory(): React.JSX.Element { return ( diff --git a/packages/sanity/src/core/comments/components/pte/CommentMessageSerializer.tsx b/packages/sanity/src/core/comments/components/pte/CommentMessageSerializer.tsx index 0a315e682ef..dd4a236f74a 100644 --- a/packages/sanity/src/core/comments/components/pte/CommentMessageSerializer.tsx +++ b/packages/sanity/src/core/comments/components/pte/CommentMessageSerializer.tsx @@ -78,7 +78,7 @@ interface CommentMessageSerializerProps { * @beta * @hidden */ -export function CommentMessageSerializer(props: CommentMessageSerializerProps): JSX.Element { +export function CommentMessageSerializer(props: CommentMessageSerializerProps): React.JSX.Element { const {blocks} = props return ( diff --git a/packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.tsx b/packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.tsx index 338136e9bd6..85787534215 100644 --- a/packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.tsx +++ b/packages/sanity/src/core/comments/components/pte/blocks/NormalBlock.tsx @@ -10,7 +10,7 @@ interface NormalBlockProps { children: ReactNode } -export function NormalBlock(props: NormalBlockProps): JSX.Element { +export function NormalBlock(props: NormalBlockProps): React.JSX.Element { const {children} = props return {children} diff --git a/packages/sanity/src/core/comments/components/reactions/CommentReactionsMenuButton.tsx b/packages/sanity/src/core/comments/components/reactions/CommentReactionsMenuButton.tsx index 974855a1241..365a1f110e7 100644 --- a/packages/sanity/src/core/comments/components/reactions/CommentReactionsMenuButton.tsx +++ b/packages/sanity/src/core/comments/components/reactions/CommentReactionsMenuButton.tsx @@ -20,7 +20,7 @@ export interface CommentReactionsMenuButtonProps { open: boolean tooltipContent: string t: TFunction - }) => React.ReactElement + }) => React.ReactElement } export function CommentReactionsMenuButton(props: CommentReactionsMenuButtonProps) { diff --git a/packages/sanity/src/core/comments/components/reactions/CommentReactionsUsersTooltip.tsx b/packages/sanity/src/core/comments/components/reactions/CommentReactionsUsersTooltip.tsx index 50126e0d88b..c340d7b2e39 100644 --- a/packages/sanity/src/core/comments/components/reactions/CommentReactionsUsersTooltip.tsx +++ b/packages/sanity/src/core/comments/components/reactions/CommentReactionsUsersTooltip.tsx @@ -89,7 +89,7 @@ function FormattedUserList({currentUserId, userIds}: {currentUserId: string; use * not special case on _comma_ per se, but rather by the presence of a non-whitespace character. */ const parts = listFormat.formatToParts(userIds) - const elements: JSX.Element[] = [] + const elements: React.JSX.Element[] = [] for (let i = 0; i < parts.length; i++) { const item = parts[i] diff --git a/packages/sanity/src/core/components/DefaultDocument.tsx b/packages/sanity/src/core/components/DefaultDocument.tsx index 25bc84feb17..cc7246a8ac4 100644 --- a/packages/sanity/src/core/components/DefaultDocument.tsx +++ b/packages/sanity/src/core/components/DefaultDocument.tsx @@ -122,7 +122,7 @@ const EMPTY_ARRAY: never[] = [] /** * @hidden * @beta */ -export function DefaultDocument(props: DefaultDocumentProps): ReactElement { +export function DefaultDocument(props: DefaultDocumentProps): ReactElement { const {entryPath, css = EMPTY_ARRAY} = props return ( diff --git a/packages/sanity/src/core/components/WithReferringDocuments.tsx b/packages/sanity/src/core/components/WithReferringDocuments.tsx index ef784d2c6a3..c835df44ab5 100644 --- a/packages/sanity/src/core/components/WithReferringDocuments.tsx +++ b/packages/sanity/src/core/components/WithReferringDocuments.tsx @@ -14,7 +14,7 @@ export function WithReferringDocuments({ children, id, }: { - children: (props: {isLoading: boolean; referringDocuments: SanityDocument[]}) => ReactElement + children: (props: {isLoading: boolean; referringDocuments: SanityDocument[]}) => ReactElement /** * @deprecated - no longer required */ diff --git a/packages/sanity/src/core/components/collapseMenu/CollapseMenu.tsx b/packages/sanity/src/core/components/collapseMenu/CollapseMenu.tsx index 6f6a6542232..9b46e5cbc50 100644 --- a/packages/sanity/src/core/components/collapseMenu/CollapseMenu.tsx +++ b/packages/sanity/src/core/components/collapseMenu/CollapseMenu.tsx @@ -30,7 +30,7 @@ export interface CollapseMenuProps { gap?: number | number[] menuButtonProps?: Omit & { id?: string - button?: ReactElement + button?: ReactElement } onMenuClose?: () => void } @@ -73,13 +73,13 @@ const OptionObserveElement = styled(ObserveElement)` ${OPTION_STYLE} ` -function _isReactElement(node: unknown): node is ReactElement { +function _isReactElement(node: unknown): node is ReactElement { return Boolean(node) } interface IntersectionEntry { intersects: boolean - element: ReactElement + element: ReactElement // todo: potentially add bounding rects so we can calculate how many we can fit non-collapsed vs collapsed } @@ -126,7 +126,7 @@ export const CollapseMenu = forwardRef(function CollapseMenu( /** @internal */ export const AutoCollapseMenu = forwardRef(function AutoCollapseMenu( - props: Omit & {menuOptions: ReactElement[]}, + props: Omit & {menuOptions: ReactElement[]}, ref: ForwardedRef, ) { const { @@ -180,7 +180,7 @@ export const AutoCollapseMenu = forwardRef(function AutoCollapseMenu( ) const handleExpandedIntersection = useCallback( - (e: IntersectionObserverEntry, element: ReactElement) => { + (e: IntersectionObserverEntry, element: ReactElement) => { setExpandedIntersections((current) => { const key = element.key if (key === null) { @@ -205,7 +205,7 @@ export const AutoCollapseMenu = forwardRef(function AutoCollapseMenu( ) const handleCollapsedIntersection = useCallback( - (e: IntersectionObserverEntry, element: ReactElement) => { + (e: IntersectionObserverEntry, element: ReactElement) => { setCollapsedIntersections((current) => { const key = element.key if (key === null) { @@ -335,10 +335,10 @@ export const AutoCollapseMenu = forwardRef(function AutoCollapseMenu( }) const RenderHidden = memo(function RenderHidden(props: { - elements: ReactElement[] + elements: ReactElement[] gap?: number | number[] intersectionOptions: IntersectionObserverInit - onIntersectionChange: (e: IntersectionObserverEntry, element: ReactElement) => void + onIntersectionChange: (e: IntersectionObserverEntry, element: ReactElement) => void }) { const {elements, gap, intersectionOptions, onIntersectionChange} = props return ( diff --git a/packages/sanity/src/core/components/collapseMenu/CollapseMenuButton.tsx b/packages/sanity/src/core/components/collapseMenu/CollapseMenuButton.tsx index 31eff1cd059..b2271431713 100644 --- a/packages/sanity/src/core/components/collapseMenu/CollapseMenuButton.tsx +++ b/packages/sanity/src/core/components/collapseMenu/CollapseMenuButton.tsx @@ -10,7 +10,7 @@ import {Button, type ButtonProps, type TooltipProps} from '../../../ui-component /** @internal */ export interface CommonProps extends Omit { - as?: ElementType | keyof JSX.IntrinsicElements + as?: ElementType | keyof React.JSX.IntrinsicElements dividerBefore?: boolean focused?: boolean tooltipProps?: TooltipProps diff --git a/packages/sanity/src/core/components/collapseMenu/CollapseOverflowMenu.tsx b/packages/sanity/src/core/components/collapseMenu/CollapseOverflowMenu.tsx index d37318090d8..6b9fab0016d 100644 --- a/packages/sanity/src/core/components/collapseMenu/CollapseOverflowMenu.tsx +++ b/packages/sanity/src/core/components/collapseMenu/CollapseOverflowMenu.tsx @@ -13,7 +13,7 @@ export const CollapseOverflowMenu = forwardRef(function CollapseOverflowMenu( props: Pick< CollapseMenuProps, 'disableRestoreFocusOnClose' | 'menuButtonProps' | 'onMenuClose' - > & {menuOptions: ReactElement[]; menuButton: ReactElement}, + > & {menuOptions: ReactElement[]; menuButton: ReactElement}, forwardedRef: ForwardedRef, ) { const {disableRestoreFocusOnClose, menuButton, menuButtonProps, menuOptions, onMenuClose} = props diff --git a/packages/sanity/src/core/components/collapseMenu/ObserveElement.tsx b/packages/sanity/src/core/components/collapseMenu/ObserveElement.tsx index be88e0324a0..e4312b49459 100644 --- a/packages/sanity/src/core/components/collapseMenu/ObserveElement.tsx +++ b/packages/sanity/src/core/components/collapseMenu/ObserveElement.tsx @@ -2,7 +2,7 @@ import {Flex} from '@sanity/ui' import {type ReactElement, useEffect, useState} from 'react' interface ObserveElementProps { - children: ReactElement + children: ReactElement options?: IntersectionObserverInit onIntersectionChange: IntersectionObserverCallback } diff --git a/packages/sanity/src/core/components/collapseTabList/CollapseTabList.tsx b/packages/sanity/src/core/components/collapseTabList/CollapseTabList.tsx index d91b7a6ac55..8bbb60c2976 100644 --- a/packages/sanity/src/core/components/collapseTabList/CollapseTabList.tsx +++ b/packages/sanity/src/core/components/collapseTabList/CollapseTabList.tsx @@ -17,7 +17,7 @@ import {CollapseOverflowMenu} from '../collapseMenu/CollapseOverflowMenu' import {ObserveElement} from '../collapseMenu/ObserveElement' import {ContextMenuButton} from '../contextMenuButton' -function _isReactElement(node: unknown): node is ReactElement { +function _isReactElement(node: unknown): node is ReactElement { return Boolean(node) } @@ -40,7 +40,7 @@ interface CollapseTabListProps { gap?: number | number[] menuButtonProps?: Omit & { id?: string - button?: ReactElement + button?: ReactElement } onMenuClose?: () => void collapsed?: boolean @@ -65,7 +65,7 @@ export const CollapseTabList = forwardRef(function CollapseTabList( ...rest } = props const [rootEl, setRootEl] = useState(null) - const [hiddenElements, setHiddenElements] = useState([]) + const [hiddenElements, setHiddenElements] = useState[]>([]) const [showChildren, setShowChildren] = useState(false) const children = useMemo( @@ -102,12 +102,12 @@ export const CollapseTabList = forwardRef(function CollapseTabList( collapsed ? children : // eslint-disable-next-line max-nested-callbacks - children.filter(({key}) => hiddenElements.find((o: ReactElement) => o.key === key)), + children.filter(({key}) => hiddenElements.find((o: ReactElement) => o.key === key)), [children, hiddenElements, collapsed], ) const handleIntersection = useCallback( - (e: IntersectionObserverEntry, child: ReactElement) => { + (e: IntersectionObserverEntry, child: ReactElement) => { const isHidden = hiddenElements.some((el) => el.key === child.key) if (!showChildren) setShowChildren(true) diff --git a/packages/sanity/src/core/components/commandList/CommandList.tsx b/packages/sanity/src/core/components/commandList/CommandList.tsx index c4c44978074..aaf1f8e9e49 100644 --- a/packages/sanity/src/core/components/commandList/CommandList.tsx +++ b/packages/sanity/src/core/components/commandList/CommandList.tsx @@ -608,7 +608,7 @@ const CommandListComponent = forwardRef(fun disabled, selected, virtualIndex, - }) as ReactElement + }) as ReactElement // @TODO can we avoid using cloneElement here? const clonedItem = diff --git a/packages/sanity/src/core/components/hookCollection/GetHookCollectionState.tsx b/packages/sanity/src/core/components/hookCollection/GetHookCollectionState.tsx index a310675ae48..9a412df18ac 100644 --- a/packages/sanity/src/core/components/hookCollection/GetHookCollectionState.tsx +++ b/packages/sanity/src/core/components/hookCollection/GetHookCollectionState.tsx @@ -33,4 +33,4 @@ GetHookCollectionStateComponent.displayName = 'Memo(GetHookCollectionState)' /** @internal */ export const GetHookCollectionState = GetHookCollectionStateComponent as ( props: GetHookCollectionStateProps, -) => JSX.Element +) => React.JSX.Element diff --git a/packages/sanity/src/core/components/previews/_common/Media.tsx b/packages/sanity/src/core/components/previews/_common/Media.tsx index b81c46daf97..8acd19e2751 100644 --- a/packages/sanity/src/core/components/previews/_common/Media.tsx +++ b/packages/sanity/src/core/components/previews/_common/Media.tsx @@ -49,13 +49,7 @@ function renderMedia(props: { if (isValidElementType(media)) { const MediaComponent = media - return ( - - ) + return } if (typeof media === 'string') { diff --git a/packages/sanity/src/core/components/previews/helpers.tsx b/packages/sanity/src/core/components/previews/helpers.tsx index b85beb80929..bc46c81f131 100644 --- a/packages/sanity/src/core/components/previews/helpers.tsx +++ b/packages/sanity/src/core/components/previews/helpers.tsx @@ -10,13 +10,7 @@ export function renderPreviewMedia( ): ReactNode { if (isValidElementType(value)) { const Value = value - return ( - - ) + return } if (typeof value === 'string') { @@ -38,12 +32,7 @@ export function renderPreviewNode( if (isValidElementType(value)) { const Value = value - return ( - - ) + return } // @todo: find out why `value` isn't infered as `ReactNode` here diff --git a/packages/sanity/src/core/components/previews/template/TemplatePreview.tsx b/packages/sanity/src/core/components/previews/template/TemplatePreview.tsx index 545bf6fa24c..2e26e30b34e 100644 --- a/packages/sanity/src/core/components/previews/template/TemplatePreview.tsx +++ b/packages/sanity/src/core/components/previews/template/TemplatePreview.tsx @@ -86,20 +86,14 @@ export function TemplatePreview(props: TemplatePreviewProps) { {isValidElementType(Title) && ( - + <Title layout="default" /> </Text> )} {isValidElement(Title) && <Text textOverflow="ellipsis">{Title}</Text>} {isValidElementType(Subtitle) && ( <Text muted size={1} textOverflow="ellipsis"> - <Subtitle - // @ts-expect-error - @todo fix typings - layout="default" - /> + <Subtitle layout="default" /> </Text> )} {isValidElement(Subtitle) && ( diff --git a/packages/sanity/src/core/components/previews/types.ts b/packages/sanity/src/core/components/previews/types.ts index 9c22873ba6d..0c8d9b5f35d 100644 --- a/packages/sanity/src/core/components/previews/types.ts +++ b/packages/sanity/src/core/components/previews/types.ts @@ -65,7 +65,7 @@ export interface PreviewProps<TLayoutKey = PreviewLayoutKey> { withRadius?: boolean withShadow?: boolean schemaType?: SchemaType - renderDefault: (props: PreviewProps) => ReactElement + renderDefault: (props: PreviewProps) => ReactElement<any> } /** diff --git a/packages/sanity/src/core/components/scroll/scrollContainer.tsx b/packages/sanity/src/core/components/scroll/scrollContainer.tsx index f8a39fdb2e3..bf19196dc23 100644 --- a/packages/sanity/src/core/components/scroll/scrollContainer.tsx +++ b/packages/sanity/src/core/components/scroll/scrollContainer.tsx @@ -15,7 +15,7 @@ import {ScrollContext} from 'sanity/_singletons' /** @internal */ export interface ScrollContainerProps<T extends ElementType> extends Omit<HTMLProps<T>, 'as' | 'onScroll'> { - as?: ElementType | keyof JSX.IntrinsicElements + as?: ElementType | keyof React.JSX.IntrinsicElements onScroll?: (event: Event) => () => void } diff --git a/packages/sanity/src/core/components/zOffsets/ZIndexProvider.tsx b/packages/sanity/src/core/components/zOffsets/ZIndexProvider.tsx index 42a9cfd0629..27af0aa6376 100644 --- a/packages/sanity/src/core/components/zOffsets/ZIndexProvider.tsx +++ b/packages/sanity/src/core/components/zOffsets/ZIndexProvider.tsx @@ -6,6 +6,6 @@ import {ZIndexContext, zIndexContextDefaults} from 'sanity/_singletons' * * @internal */ -export function ZIndexProvider({children}: {children?: ReactNode}): ReactElement { +export function ZIndexProvider({children}: {children?: ReactNode}): ReactElement<any> { return <ZIndexContext.Provider value={zIndexContextDefaults}>{children}</ZIndexContext.Provider> } diff --git a/packages/sanity/src/core/config/prepareConfig.tsx b/packages/sanity/src/core/config/prepareConfig.tsx index fcf90db48a5..e04c866605f 100644 --- a/packages/sanity/src/core/config/prepareConfig.tsx +++ b/packages/sanity/src/core/config/prepareConfig.tsx @@ -70,7 +70,7 @@ function normalizeIcon( Icon: ComponentType | ElementType | undefined, title: string, subtitle = '', -): JSX.Element { +): React.JSX.Element { if (isValidElementType(Icon)) return <Icon /> if (isValidElement(Icon)) return Icon return createDefaultIcon(title, subtitle) diff --git a/packages/sanity/src/core/config/studio/types.ts b/packages/sanity/src/core/config/studio/types.ts index a47f7693fe0..c0692ce6e6b 100644 --- a/packages/sanity/src/core/config/studio/types.ts +++ b/packages/sanity/src/core/config/studio/types.ts @@ -7,7 +7,7 @@ import {type Tool} from '../types' * @beta */ // Components export interface LayoutProps { - renderDefault: (props: LayoutProps) => ReactElement + renderDefault: (props: LayoutProps) => ReactElement<any> } /** @@ -15,7 +15,7 @@ export interface LayoutProps { * @beta */ export interface LogoProps { title: string - renderDefault: (props: LogoProps) => ReactElement + renderDefault: (props: LogoProps) => ReactElement<any> } /** @@ -36,7 +36,7 @@ export interface NavbarAction { * @hidden * @beta */ export interface NavbarProps { - renderDefault: (props: NavbarProps) => ReactElement + renderDefault: (props: NavbarProps) => ReactElement<any> /** * @internal @@ -48,7 +48,7 @@ export interface NavbarProps { * @hidden * @beta */ export interface ActiveToolLayoutProps { - renderDefault: (props: ActiveToolLayoutProps) => React.ReactElement + renderDefault: (props: ActiveToolLayoutProps) => React.ReactElement<any> activeTool: Tool } @@ -61,7 +61,7 @@ export interface ToolMenuProps { context: 'sidebar' | 'topbar' isSidebarOpen: boolean tools: Tool[] - renderDefault: (props: ToolMenuProps) => ReactElement + renderDefault: (props: ToolMenuProps) => ReactElement<any> } /** diff --git a/packages/sanity/src/core/config/types.ts b/packages/sanity/src/core/config/types.ts index 17ae21b1c85..dea8439d1a0 100644 --- a/packages/sanity/src/core/config/types.ts +++ b/packages/sanity/src/core/config/types.ts @@ -588,7 +588,7 @@ export interface DocumentLayoutProps { * The type of the document. This is a read-only property and changing it will have no effect. */ documentType: string - renderDefault: (props: DocumentLayoutProps) => React.ReactElement + renderDefault: (props: DocumentLayoutProps) => React.ReactElement<any> } interface DocumentComponents { diff --git a/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx b/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx index d1ae36a1105..5d58ee1905c 100644 --- a/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx +++ b/packages/sanity/src/core/create/context/SanityCreateConfigProvider.tsx @@ -15,7 +15,9 @@ interface SanityCreateConfigProviderProps { /** * @internal */ -export function SanityCreateConfigProvider(props: SanityCreateConfigProviderProps): JSX.Element { +export function SanityCreateConfigProvider( + props: SanityCreateConfigProviderProps, +): React.JSX.Element { const {children} = props const {beta} = useSource() diff --git a/packages/sanity/src/core/field/diff/components/ChangeList.tsx b/packages/sanity/src/core/field/diff/components/ChangeList.tsx index 0abc2113592..ca38068fc88 100644 --- a/packages/sanity/src/core/field/diff/components/ChangeList.tsx +++ b/packages/sanity/src/core/field/diff/components/ChangeList.tsx @@ -26,7 +26,7 @@ export interface ChangeListProps { } /** @internal */ -export function ChangeList({diff, fields, schemaType}: ChangeListProps): ReactElement | null { +export function ChangeList({diff, fields, schemaType}: ChangeListProps): ReactElement<any> | null { const {documentId, isComparingCurrent, value} = useDocumentChange() const docOperations = useDocumentOperation(documentId, schemaType.name) as FieldOperationsAPI const {path} = useContext(DiffContext) diff --git a/packages/sanity/src/core/field/diff/components/DiffCard.tsx b/packages/sanity/src/core/field/diff/components/DiffCard.tsx index e1e104e054f..d5eb775601d 100644 --- a/packages/sanity/src/core/field/diff/components/DiffCard.tsx +++ b/packages/sanity/src/core/field/diff/components/DiffCard.tsx @@ -10,7 +10,7 @@ import {DiffTooltip} from './DiffTooltip' /** @internal */ export interface DiffCardProps { annotation?: Annotation - as?: ElementType | keyof JSX.IntrinsicElements + as?: ElementType | keyof React.JSX.IntrinsicElements diff?: Diff disableHoverEffect?: boolean path?: Path | string diff --git a/packages/sanity/src/core/field/diff/components/DiffInspectWrapper.tsx b/packages/sanity/src/core/field/diff/components/DiffInspectWrapper.tsx index 7499bbe9f6f..87f538a9e53 100644 --- a/packages/sanity/src/core/field/diff/components/DiffInspectWrapper.tsx +++ b/packages/sanity/src/core/field/diff/components/DiffInspectWrapper.tsx @@ -26,7 +26,7 @@ const Meta = styled.div` ` /** @internal */ -export function DiffInspectWrapper(props: DiffInspectWrapperProps & BoxProps): ReactElement { +export function DiffInspectWrapper(props: DiffInspectWrapperProps & BoxProps): ReactElement<any> { const {children, as, change, ...restProps} = props const isHovering = useRef(false) const [isInspecting, setIsInspecting] = useState(false) @@ -62,7 +62,7 @@ const MetaLabel = ({title}: {title: string}) => ( </Box> ) -function DiffInspector({change}: {change: FieldChangeNode}): ReactElement | null { +function DiffInspector({change}: {change: FieldChangeNode}): ReactElement<any> | null { const {t} = useTranslation() return ( <Stack space={3}> diff --git a/packages/sanity/src/core/field/diff/components/DiffString.tsx b/packages/sanity/src/core/field/diff/components/DiffString.tsx index 3cd144e82ba..c207c6a11a4 100644 --- a/packages/sanity/src/core/field/diff/components/DiffString.tsx +++ b/packages/sanity/src/core/field/diff/components/DiffString.tsx @@ -35,7 +35,7 @@ const ChangeSegment = styled(Text)` ` /** @internal */ -export function DiffStringSegment(props: {segment: StringDiffSegment}): ReactElement { +export function DiffStringSegment(props: {segment: StringDiffSegment}): ReactElement<any> { const {segment} = props const {text} = segment const {t} = useTranslation() diff --git a/packages/sanity/src/core/field/diff/components/DiffTooltip.tsx b/packages/sanity/src/core/field/diff/components/DiffTooltip.tsx index 084e5217f97..7e5ac44fc77 100644 --- a/packages/sanity/src/core/field/diff/components/DiffTooltip.tsx +++ b/packages/sanity/src/core/field/diff/components/DiffTooltip.tsx @@ -12,7 +12,7 @@ import {getAnnotationAtPath, useAnnotationColor} from '../annotations' /** @internal */ export interface DiffTooltipProps extends TooltipProps { - children: ReactElement + children: ReactElement<any> description?: ReactNode diff: Diff path?: Path | string @@ -21,7 +21,7 @@ export interface DiffTooltipProps extends TooltipProps { /** @internal */ export interface DiffTooltipWithAnnotationsProps extends TooltipProps { annotations: AnnotationDetails[] - children: ReactElement + children: ReactElement<any> description?: ReactNode } diff --git a/packages/sanity/src/core/field/diff/components/GroupChange.tsx b/packages/sanity/src/core/field/diff/components/GroupChange.tsx index 109c3af4ca5..95f76292c02 100644 --- a/packages/sanity/src/core/field/diff/components/GroupChange.tsx +++ b/packages/sanity/src/core/field/diff/components/GroupChange.tsx @@ -33,7 +33,7 @@ export function GroupChange( readOnly?: boolean hidden?: boolean } & HTMLAttributes<HTMLDivElement>, -): ReactElement | null { +): ReactElement<any> | null { const {change: group, readOnly, hidden, ...restProps} = props const {titlePath, changes, path: groupPath} = group const {path: diffPath} = useContext(DiffContext) diff --git a/packages/sanity/src/core/field/diff/components/RevertChangesButton.tsx b/packages/sanity/src/core/field/diff/components/RevertChangesButton.tsx index c0c718e0f70..e8581a29dfa 100644 --- a/packages/sanity/src/core/field/diff/components/RevertChangesButton.tsx +++ b/packages/sanity/src/core/field/diff/components/RevertChangesButton.tsx @@ -31,7 +31,7 @@ export const RevertChangesButton = forwardRef(function RevertChangesButton( props: Omit<ButtonProps, 'tooltipProps'> & Omit<HTMLProps<HTMLButtonElement>, 'ref'> & {changeCount: number}, ref: ForwardedRef<HTMLButtonElement>, -): ReactElement { +): ReactElement<any> { const {selected, changeCount, ...restProps} = props const {t} = useTranslation() diff --git a/packages/sanity/src/core/field/types/image/diff/ImagePreview.tsx b/packages/sanity/src/core/field/types/image/diff/ImagePreview.tsx index 690a7ca077e..acb68888184 100644 --- a/packages/sanity/src/core/field/types/image/diff/ImagePreview.tsx +++ b/packages/sanity/src/core/field/types/image/diff/ImagePreview.tsx @@ -95,7 +95,7 @@ const HotspotDiff = styled.div` } ` -export function ImagePreview(props: ImagePreviewProps): ReactElement { +export function ImagePreview(props: ImagePreviewProps): ReactElement<any> { const {id, action, diff, hotspot, crop, is} = props const {t} = useTranslation() const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS) diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Block.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Block.tsx index 56484c1128e..c61b0e31b3d 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Block.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Block.tsx @@ -16,8 +16,8 @@ const EMPTY_PATH: Path = [] export function Block(props: { diff: PortableTextDiff block: PortableTextTextBlock - children: JSX.Element -}): JSX.Element { + children: React.JSX.Element +}): React.JSX.Element { const {diff, block, children} = props const color = useDiffAnnotationColor(diff, EMPTY_PATH) const {path: fullPath} = useContext(DiffContext) diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Blockquote.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Blockquote.tsx index a3becda3f81..81b8a4fa83f 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Blockquote.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Blockquote.tsx @@ -5,7 +5,7 @@ const Quote = styled.blockquote` margin: 0; ` -export function Blockquote({children}: {children: ReactNode}): JSX.Element { +export function Blockquote({children}: {children: ReactNode}): React.JSX.Element { return ( <div> <Quote>{children}</Quote> diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Decorator.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Decorator.tsx index b5aa49f53a3..203308240b4 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Decorator.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Decorator.tsx @@ -25,6 +25,6 @@ const DecoratorWrapper = styled.span<{decoration: string}>` }} ` -export function Decorator({mark, children}: {mark: string; children: JSX.Element}) { +export function Decorator({mark, children}: {mark: string; children: React.JSX.Element}) { return <DecoratorWrapper decoration={mark}>{children}</DecoratorWrapper> } diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Header.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Header.tsx index cfecee3f84a..a4073371b43 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Header.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Header.tsx @@ -24,6 +24,6 @@ const StyledHeading = styled(Heading)` } ` -export function Header({style, children}: {style: string; children: ReactNode}): JSX.Element { +export function Header({style, children}: {style: string; children: ReactNode}): React.JSX.Element { return <StyledHeading size={headingSizes[style]}>{children}</StyledHeading> } diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Paragraph.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Paragraph.tsx index 0fb5b264c91..970e9affef7 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Paragraph.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Paragraph.tsx @@ -9,6 +9,6 @@ const StyledParagraph = styled.div` margin: 0; ` -export function Paragraph({children}: {children: ReactNode}): JSX.Element { +export function Paragraph({children}: {children: ReactNode}): React.JSX.Element { return <StyledParagraph>{children}</StyledParagraph> } diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/PortableText.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/PortableText.tsx index b26cac60bb1..50e6daf2c98 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/PortableText.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/PortableText.tsx @@ -51,7 +51,7 @@ type Props = { schemaType: ObjectSchemaType } -export function PortableText(props: Props): JSX.Element { +export function PortableText(props: Props): React.JSX.Element { const {diff, schemaType} = props const block = (diff.origin.toValue || diff.origin.fromValue) as PortableTextTextBlock const {t} = useTranslation() @@ -196,7 +196,7 @@ export function PortableText(props: Props): JSX.Element { } if (endedAnnotation) { const key = `annotation-${endedAnnotation.object._key}` - const lastChild = returnedChildren[returnedChildren.length - 1] as ReactElement + const lastChild = returnedChildren[returnedChildren.length - 1] as ReactElement<any> if (lastChild && lastChild.key !== key) { const annotationDiff = findAnnotationDiff(diff.origin, endedAnnotation.mark) const objectSchemaType = @@ -258,7 +258,7 @@ function renderTextSegment({ segIndex: number spanSchemaType: SpanSchemaType t: TFunction -}): JSX.Element { +}): React.JSX.Element { // Newlines if (seg.text === '\n') { return <br /> @@ -315,13 +315,13 @@ function renderDecorators({ activeMarks: string[] decoratorTypes: {title: string; value: string}[] diff: PortableTextDiff - children: JSX.Element + children: React.JSX.Element seg: StringDiffSegment segIndex: number spanDiff: ObjectDiff spanSchemaType: SpanSchemaType t: TFunction -}): JSX.Element { +}): React.JSX.Element { let returned = <span key={`text-segment-${segIndex}`}>{children}</span> const fromPtDiffText: string = (diff.origin.fromValue && diff.fromValue && diff.fromValue.children[0].text) || '' // Always one child diff --git a/packages/sanity/src/core/field/types/portableText/diff/components/Text.tsx b/packages/sanity/src/core/field/types/portableText/diff/components/Text.tsx index e5fceb4db39..af67d83bc22 100644 --- a/packages/sanity/src/core/field/types/portableText/diff/components/Text.tsx +++ b/packages/sanity/src/core/field/types/portableText/diff/components/Text.tsx @@ -10,7 +10,7 @@ import {InlineBox} from './styledComponents' interface TextProps { diff?: StringDiff childDiff?: ObjectDiff - children: JSX.Element + children: React.JSX.Element path: Path segment: StringDiffSegment } diff --git a/packages/sanity/src/core/form/components/EditPortal.tsx b/packages/sanity/src/core/form/components/EditPortal.tsx index 2f18993ab3d..e74d6b60ede 100644 --- a/packages/sanity/src/core/form/components/EditPortal.tsx +++ b/packages/sanity/src/core/form/components/EditPortal.tsx @@ -28,7 +28,7 @@ function onDrop(event: DragEvent<HTMLDivElement>) { return event.stopPropagation() } -export function EditPortal(props: Props): ReactElement { +export function EditPortal(props: Props): ReactElement<any> { const { children, header, diff --git a/packages/sanity/src/core/form/form-components-hooks/components.tsx b/packages/sanity/src/core/form/form-components-hooks/components.tsx index a778bf1129d..d37f6a7ceb3 100644 --- a/packages/sanity/src/core/form/form-components-hooks/components.tsx +++ b/packages/sanity/src/core/form/form-components-hooks/components.tsx @@ -58,7 +58,7 @@ function useResolveDefaultComponent<T extends {schemaType?: SchemaType}>(props: /** * @internal */ -export function DefaultInput(props: Omit<InputProps, 'renderDefault'>): ReactElement { +export function DefaultInput(props: Omit<InputProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<Omit<InputProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveInputComponent, @@ -68,7 +68,7 @@ export function DefaultInput(props: Omit<InputProps, 'renderDefault'>): ReactEle /** * @internal */ -export function DefaultField(props: Omit<FieldProps, 'renderDefault'>): ReactElement { +export function DefaultField(props: Omit<FieldProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<Omit<FieldProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveFieldComponent, @@ -78,7 +78,7 @@ export function DefaultField(props: Omit<FieldProps, 'renderDefault'>): ReactEle /** * @internal */ -export function DefaultItem(props: Omit<ItemProps, 'renderDefault'>): ReactElement { +export function DefaultItem(props: Omit<ItemProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<Omit<ItemProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveItemComponent, @@ -88,7 +88,7 @@ export function DefaultItem(props: Omit<ItemProps, 'renderDefault'>): ReactEleme /** * @internal */ -export function DefaultPreview(props: Omit<PreviewProps, 'renderDefault'>): ReactElement { +export function DefaultPreview(props: Omit<PreviewProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<PreviewProps>({ componentProps: props, componentResolver: defaultResolvePreviewComponent, @@ -98,7 +98,7 @@ export function DefaultPreview(props: Omit<PreviewProps, 'renderDefault'>): Reac /** * @internal */ -export function DefaultBlock(props: Omit<BlockProps, 'renderDefault'>): ReactElement { +export function DefaultBlock(props: Omit<BlockProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<Omit<BlockProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveBlockComponent, @@ -108,7 +108,7 @@ export function DefaultBlock(props: Omit<BlockProps, 'renderDefault'>): ReactEle /** * @internal */ -export function DefaultInlineBlock(props: Omit<BlockProps, 'renderDefault'>): ReactElement { +export function DefaultInlineBlock(props: Omit<BlockProps, 'renderDefault'>): ReactElement<any> { return useResolveDefaultComponent<Omit<BlockProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveInlineBlockComponent, @@ -120,7 +120,7 @@ export function DefaultInlineBlock(props: Omit<BlockProps, 'renderDefault'>): Re */ export function DefaultAnnotation( props: Omit<BlockAnnotationProps, 'renderDefault'>, -): ReactElement { +): ReactElement<any> { return useResolveDefaultComponent<Omit<BlockAnnotationProps, 'renderDefault'>>({ componentProps: props, componentResolver: defaultResolveAnnotationComponent, diff --git a/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/ReferenceAutocomplete.tsx b/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/ReferenceAutocomplete.tsx index c3fb37655d0..817f9f94116 100644 --- a/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/ReferenceAutocomplete.tsx +++ b/packages/sanity/src/core/form/inputs/CrossDatasetReferenceInput/ReferenceAutocomplete.tsx @@ -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>, ) { @@ -46,7 +46,7 @@ export const ReferenceAutocomplete = forwardRef(function ReferenceAutocomplete( onMouseEnter, onMouseLeave, }: { - content: ReactElement | null + content: ReactElement<any> | null hidden: boolean inputElement: HTMLInputElement | null onMouseEnter: () => void diff --git a/packages/sanity/src/core/form/inputs/ObjectInput/__tests__/test-utils.tsx b/packages/sanity/src/core/form/inputs/ObjectInput/__tests__/test-utils.tsx index 5e92d8292e6..63bc38ff4a6 100644 --- a/packages/sanity/src/core/form/inputs/ObjectInput/__tests__/test-utils.tsx +++ b/packages/sanity/src/core/form/inputs/ObjectInput/__tests__/test-utils.tsx @@ -16,7 +16,7 @@ export * from '@testing-library/react' export type {RenderOptions} const customRender = ( - ui: ReactElement, + ui: ReactElement<any>, options?: Omit<RenderOptions, 'wrapper'>, ): ReturnType<typeof render> => render(ui, {wrapper: Providers, ...options}) diff --git a/packages/sanity/src/core/form/inputs/PortableText/Compositor.tsx b/packages/sanity/src/core/form/inputs/PortableText/Compositor.tsx index f587579ea1b..533bc35e333 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/Compositor.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/Compositor.tsx @@ -36,7 +36,7 @@ import {AnnotationObjectEditModal} from './object/modals/AnnotationObjectEditMod import {TextBlock} from './text' interface InputProps extends ArrayOfObjectsInputProps<PortableTextBlock> { - elementRef: React.RefObject<HTMLDivElement> + elementRef: React.RefObject<HTMLDivElement | null> hasFocusWithin: boolean hideToolbar?: boolean hotkeys?: HotkeyOptions diff --git a/packages/sanity/src/core/form/inputs/PortableText/Editor.tsx b/packages/sanity/src/core/form/inputs/PortableText/Editor.tsx index 505b1cf9e68..bef3ec457bf 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/Editor.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/Editor.tsx @@ -47,7 +47,7 @@ const PlaceholderWrapper = styled.span((props) => { }) interface EditorProps { - elementRef: React.RefObject<HTMLDivElement> + elementRef: React.RefObject<HTMLDivElement | null> hideToolbar?: boolean hotkeys: HotkeyOptions initialSelection?: EditorSelection diff --git a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/defaultSchema/Story.tsx b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/defaultSchema/Story.tsx index a85d04cb8b7..5e2940095a8 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/__workshop__/defaultSchema/Story.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/__workshop__/defaultSchema/Story.tsx @@ -53,7 +53,7 @@ function TestForm() { const patchChannel = useMemo(() => createPatchChannel(), []) const [focusPath, setFocusPath] = useState<Path>([]) const changed = false - const focusRef = useRef() + const focusRef = useRef(undefined) const handleAppendItem = useAction('onItemAppend') const handleBlur = useAction('onBlur') const handleFocus = useAction('onFocus') diff --git a/packages/sanity/src/core/form/inputs/PortableText/object/Annotation.tsx b/packages/sanity/src/core/form/inputs/PortableText/object/Annotation.tsx index c37a92b7bbd..b34c27e80be 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/object/Annotation.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/object/Annotation.tsx @@ -37,7 +37,7 @@ import {Root, TooltipBox} from './Annotation.styles' import {AnnotationToolbarPopover} from './AnnotationToolbarPopover' interface AnnotationProps { - children: ReactElement + children: ReactElement<any> editorNodeFocused: boolean floatingBoundary: HTMLElement | null focused: boolean diff --git a/packages/sanity/src/core/form/inputs/PortableText/object/BlockObjectActionsMenu.tsx b/packages/sanity/src/core/form/inputs/PortableText/object/BlockObjectActionsMenu.tsx index 14ec96e3e44..d62ecee4650 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/object/BlockObjectActionsMenu.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/object/BlockObjectActionsMenu.tsx @@ -34,7 +34,7 @@ const POPOVER_PROPS: MenuButtonProps['popover'] = { tone: 'default', } -export function BlockObjectActionsMenu(props: BlockObjectActionsMenuProps): ReactElement { +export function BlockObjectActionsMenu(props: BlockObjectActionsMenuProps): ReactElement<any> { const {children, focused, isOpen, onOpen, onRemove, readOnly, value} = props const {t} = useTranslation() const menuButtonId = useId() diff --git a/packages/sanity/src/core/form/inputs/PortableText/presence-cursors/UserPresenceCursor.tsx b/packages/sanity/src/core/form/inputs/PortableText/presence-cursors/UserPresenceCursor.tsx index ab30643a483..3418e7f4d94 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/presence-cursors/UserPresenceCursor.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/presence-cursors/UserPresenceCursor.tsx @@ -112,7 +112,7 @@ interface UserPresenceCursorProps { user: User } -export function UserPresenceCursor(props: UserPresenceCursorProps): JSX.Element { +export function UserPresenceCursor(props: UserPresenceCursorProps): React.JSX.Element { const {children, user} = props const {tints} = useUserColor(user.id) const [hovered, setHovered] = useState<boolean>(false) diff --git a/packages/sanity/src/core/form/inputs/PortableText/toolbar/BlockStyleSelect.tsx b/packages/sanity/src/core/form/inputs/PortableText/toolbar/BlockStyleSelect.tsx index 2c0a9a5bc8e..d99b64b3394 100644 --- a/packages/sanity/src/core/form/inputs/PortableText/toolbar/BlockStyleSelect.tsx +++ b/packages/sanity/src/core/form/inputs/PortableText/toolbar/BlockStyleSelect.tsx @@ -70,7 +70,7 @@ const emptyStyle: BlockStyleItem = { export const BlockStyleSelect = memo(function BlockStyleSelect( props: BlockStyleSelectProps, -): JSX.Element { +): React.JSX.Element { const {disabled, items: itemsProp, boundaryElement} = props const editor = usePortableTextEditor() const focusBlock = useFocusBlock() diff --git a/packages/sanity/src/core/form/inputs/ReferenceInput/CreateButton.tsx b/packages/sanity/src/core/form/inputs/ReferenceInput/CreateButton.tsx index 3634c07217b..a707c11af63 100644 --- a/packages/sanity/src/core/form/inputs/ReferenceInput/CreateButton.tsx +++ b/packages/sanity/src/core/form/inputs/ReferenceInput/CreateButton.tsx @@ -18,7 +18,7 @@ interface Props extends Omit<HTMLProps<HTMLButtonElement>, 'as' | 'size' | 'width' | 'type' | 'ref'> { id: string createOptions: CreateReferenceOption[] - menuRef?: RefObject<HTMLDivElement> + menuRef?: RefObject<HTMLDivElement | null> onCreate: (option: CreateReferenceOption) => void readOnly?: boolean } diff --git a/packages/sanity/src/core/form/inputs/ReferenceInput/ReferenceAutocomplete.tsx b/packages/sanity/src/core/form/inputs/ReferenceInput/ReferenceAutocomplete.tsx index 80b4bf6e5e7..f6d46da1dba 100644 --- a/packages/sanity/src/core/form/inputs/ReferenceInput/ReferenceAutocomplete.tsx +++ b/packages/sanity/src/core/form/inputs/ReferenceInput/ReferenceAutocomplete.tsx @@ -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>, ) { @@ -46,7 +46,7 @@ export const ReferenceAutocomplete = forwardRef(function ReferenceAutocomplete( onMouseEnter, onMouseLeave, }: { - content: ReactElement | null + content: ReactElement<any> | null hidden: boolean inputElement: HTMLInputElement | null onMouseEnter: () => void diff --git a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInput.tsx b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInput.tsx index d9f85e56a36..1b63da9b017 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInput.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInput.tsx @@ -26,7 +26,7 @@ import {type BaseImageInputProps, type BaseImageInputValue, type FileInfo} from export {BaseImageInputProps, BaseImageInputValue} -function BaseImageInputComponent(props: BaseImageInputProps): JSX.Element { +function BaseImageInputComponent(props: BaseImageInputProps): React.JSX.Element { const { assetSources, client, @@ -275,7 +275,7 @@ function BaseImageInputComponent(props: BaseImageInputProps): JSX.Element { menuButtonElement?.focus() }, [menuButtonElement]) - const renderPreview = useCallback<() => JSX.Element>(() => { + const renderPreview = useCallback<() => React.JSX.Element>(() => { if (!value) { return <></> } diff --git a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputAsset.tsx b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputAsset.tsx index c07bbfdf903..1100dd2405f 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputAsset.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputAsset.tsx @@ -24,10 +24,10 @@ function ImageInputAssetComponent(props: { inputProps: Omit<InputProps, 'renderDefault'> isStale: boolean readOnly: boolean | undefined - renderAssetMenu(): JSX.Element | null - renderPreview: () => JSX.Element - renderUploadPlaceholder(): JSX.Element - renderUploadState(uploadState: UploadState): JSX.Element + renderAssetMenu(): React.JSX.Element | null + renderPreview: () => React.JSX.Element + renderUploadPlaceholder(): React.JSX.Element + renderUploadState(uploadState: UploadState): React.JSX.Element tone: CardTone value: BaseImageInputValue | undefined }) { diff --git a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputUploadPlaceholder.tsx b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputUploadPlaceholder.tsx index 440c2bdf4fc..a0b7c414d16 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputUploadPlaceholder.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageInput/ImageInputUploadPlaceholder.tsx @@ -10,7 +10,7 @@ function ImageInputUploadPlaceholderComponent(props: { handleSelectFiles: (files: File[]) => void hoveringFiles: FileInfo[] readOnly: boolean | undefined - renderBrowser(): JSX.Element | null + renderBrowser(): React.JSX.Element | null resolveUploader: BaseImageInputProps['resolveUploader'] schemaType: BaseImageInputProps['schemaType'] }) { diff --git a/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/DragAwareCanvas.tsx b/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/DragAwareCanvas.tsx index 7275c09bcd0..26cedca562d 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/DragAwareCanvas.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/DragAwareCanvas.tsx @@ -23,7 +23,7 @@ export interface DragAwareCanvasProps { } const DragAwareCanvasComponent = forwardRef<HTMLCanvasElement, DragAwareCanvasProps>( - function DragAwareCanvas(props, ref): JSX.Element { + function DragAwareCanvas(props, ref): React.JSX.Element { const {readOnly, onDragStart, onDragEnd, onDrag, ...rest} = props const domNode = useRef<HTMLCanvasElement | null>(null) diff --git a/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/ImageLoader.tsx b/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/ImageLoader.tsx index e43171566c4..1cb39a91be3 100644 --- a/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/ImageLoader.tsx +++ b/packages/sanity/src/core/form/inputs/files/ImageToolInput/imagetool/ImageLoader.tsx @@ -7,7 +7,7 @@ interface ImageLoaderProps { isLoading: boolean image: HTMLImageElement | null error: Error | null - }) => ReactElement | null + }) => ReactElement<any> | null } export function ImageLoader(props: ImageLoaderProps) { diff --git a/packages/sanity/src/core/form/inputs/files/common/FileInputMenuItem/FileInputMenuItem.tsx b/packages/sanity/src/core/form/inputs/files/common/FileInputMenuItem/FileInputMenuItem.tsx index 612662e1b59..b24a08991c8 100644 --- a/packages/sanity/src/core/form/inputs/files/common/FileInputMenuItem/FileInputMenuItem.tsx +++ b/packages/sanity/src/core/form/inputs/files/common/FileInputMenuItem/FileInputMenuItem.tsx @@ -36,7 +36,7 @@ export const FileInputMenuItem = forwardRef(function FileInputMenuItem( ) const renderMenuItem = useCallback( - (item: JSX.Element) => ( + (item: React.JSX.Element) => ( <div> {item} {/* Visibly hidden input */} diff --git a/packages/sanity/src/core/form/members/array/items/ArrayOfObjectsItem.tsx b/packages/sanity/src/core/form/members/array/items/ArrayOfObjectsItem.tsx index 75381e61af7..71e3e147b90 100644 --- a/packages/sanity/src/core/form/members/array/items/ArrayOfObjectsItem.tsx +++ b/packages/sanity/src/core/form/members/array/items/ArrayOfObjectsItem.tsx @@ -53,7 +53,7 @@ export interface MemberItemProps { * @beta */ export function ArrayOfObjectsItem(props: MemberItemProps) { - const focusRef = useRef<{focus: () => void}>() + const focusRef = useRef<{focus: () => void}>(undefined) const { member, renderAnnotation, diff --git a/packages/sanity/src/core/form/members/array/items/ArrayOfPrimitivesItem.tsx b/packages/sanity/src/core/form/members/array/items/ArrayOfPrimitivesItem.tsx index 92621c95e80..cce64b058f6 100644 --- a/packages/sanity/src/core/form/members/array/items/ArrayOfPrimitivesItem.tsx +++ b/packages/sanity/src/core/form/members/array/items/ArrayOfPrimitivesItem.tsx @@ -37,7 +37,7 @@ export interface PrimitiveMemberItemProps { * @beta */ export function ArrayOfPrimitivesItem(props: PrimitiveMemberItemProps) { - const focusRef = useRef<{focus: () => void}>() + const focusRef = useRef<{focus: () => void}>(undefined) const {member, renderItem, renderInput} = props const [localValue, setLocalValue] = useState<undefined | string>() diff --git a/packages/sanity/src/core/form/members/object/fields/ArrayOfObjectsField.tsx b/packages/sanity/src/core/form/members/object/fields/ArrayOfObjectsField.tsx index 6e68f79e074..ac7c2a1184f 100644 --- a/packages/sanity/src/core/form/members/object/fields/ArrayOfObjectsField.tsx +++ b/packages/sanity/src/core/form/members/object/fields/ArrayOfObjectsField.tsx @@ -76,7 +76,7 @@ export function ArrayOfObjectsField(props: { const fieldActions = useDocumentFieldActions() - const focusRef = useRef<Element & {focus: () => void}>() + const focusRef = useRef<Element & {focus: () => void}>(undefined) const uploadSubscriptions = useRef<Record<string, Subscription>>({}) useDidUpdate(member.field.focused, (hadFocus, hasFocus) => { diff --git a/packages/sanity/src/core/form/members/object/fields/ArrayOfPrimitivesField.tsx b/packages/sanity/src/core/form/members/object/fields/ArrayOfPrimitivesField.tsx index 6be94b28a40..454c7ba3a28 100644 --- a/packages/sanity/src/core/form/members/object/fields/ArrayOfPrimitivesField.tsx +++ b/packages/sanity/src/core/form/members/object/fields/ArrayOfPrimitivesField.tsx @@ -159,8 +159,8 @@ export function ArrayOfPrimitivesField(props: { } = props const fieldActions = useDocumentFieldActions() - const focusRef = useRef<Element & {focus: () => void}>() - const uploadSubscriptions = useRef<Subscription>() + const focusRef = useRef<Element & {focus: () => void}>(undefined) + const uploadSubscriptions = useRef<Subscription>(undefined) const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS) useDidUpdate(member.field.focused, (hadFocus, hasFocus) => { diff --git a/packages/sanity/src/core/form/members/object/fields/ObjectField.tsx b/packages/sanity/src/core/form/members/object/fields/ObjectField.tsx index 3bebe912c04..13f5a573cff 100644 --- a/packages/sanity/src/core/form/members/object/fields/ObjectField.tsx +++ b/packages/sanity/src/core/form/members/object/fields/ObjectField.tsx @@ -58,7 +58,7 @@ export const ObjectField = function ObjectField(props: { renderPreview, } = props const fieldActions = useDocumentFieldActions() - const focusRef = useRef<{focus: () => void}>() + const focusRef = useRef<{focus: () => void}>(undefined) // Keep a local reference to the most recent value. See comment in `handleChange` below for more details const pendingValue = useRef(member.field.value) diff --git a/packages/sanity/src/core/form/members/object/fields/PrimitiveField.tsx b/packages/sanity/src/core/form/members/object/fields/PrimitiveField.tsx index bfa42f9fa2a..17e325e323b 100644 --- a/packages/sanity/src/core/form/members/object/fields/PrimitiveField.tsx +++ b/packages/sanity/src/core/form/members/object/fields/PrimitiveField.tsx @@ -29,7 +29,7 @@ export function PrimitiveField(props: { const fieldActions = useDocumentFieldActions() - const focusRef = useRef<{focus: () => void}>() + const focusRef = useRef<{focus: () => void}>(undefined) const [localValue, setLocalValue] = useState<string | undefined>() diff --git a/packages/sanity/src/core/form/studio/FormBuilder.tsx b/packages/sanity/src/core/form/studio/FormBuilder.tsx index 58e1f1d04bf..121c5b07659 100644 --- a/packages/sanity/src/core/form/studio/FormBuilder.tsx +++ b/packages/sanity/src/core/form/studio/FormBuilder.tsx @@ -296,7 +296,7 @@ interface RootInputProps { rootInputProps: Omit<ObjectInputProps, 'renderDefault'> onPathOpen: (path: Path) => void openPath: Path - renderInput: (props: Omit<ObjectInputProps, 'renderDefault'>) => JSX.Element + renderInput: (props: Omit<ObjectInputProps, 'renderDefault'>) => React.JSX.Element } function RootInput(props: RootInputProps) { diff --git a/packages/sanity/src/core/form/studio/FormBuilderInputErrorBoundary.tsx b/packages/sanity/src/core/form/studio/FormBuilderInputErrorBoundary.tsx index 17caafefdb0..b8c7d726253 100644 --- a/packages/sanity/src/core/form/studio/FormBuilderInputErrorBoundary.tsx +++ b/packages/sanity/src/core/form/studio/FormBuilderInputErrorBoundary.tsx @@ -22,7 +22,7 @@ interface FormBuilderInputErrorBoundaryProps { */ export function FormBuilderInputErrorBoundary( props: FormBuilderInputErrorBoundaryProps, -): JSX.Element { +): React.JSX.Element { const {children} = props const [{error, info}, setError] = useState<{error: unknown; info: React.ErrorInfo}>({ error: null, diff --git a/packages/sanity/src/core/form/studio/assetSource/file/AssetRow.tsx b/packages/sanity/src/core/form/studio/assetSource/file/AssetRow.tsx index 305ac9f6e25..cdae2c8eeb3 100644 --- a/packages/sanity/src/core/form/studio/assetSource/file/AssetRow.tsx +++ b/packages/sanity/src/core/form/studio/assetSource/file/AssetRow.tsx @@ -131,7 +131,7 @@ const STYLES_ASSETMENU_WRAPPER = { export const AssetRow = (props: RowProps): React.JSX.Element => { const versionedClient = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS) const toast = useToast() - const deleteRef$ = useRef<Subscription>() + const deleteRef$ = useRef<Subscription>(undefined) const [showUsageDialog, setShowUsageDialog] = useState(false) const [showDeleteDialog, setShowDeleteDialog] = useState(false) const [isDeleting, setIsDeleting] = useState(false) diff --git a/packages/sanity/src/core/form/studio/assetSource/image/AssetThumb.tsx b/packages/sanity/src/core/form/studio/assetSource/image/AssetThumb.tsx index faa773c407d..bcd7d31e8fc 100644 --- a/packages/sanity/src/core/form/studio/assetSource/image/AssetThumb.tsx +++ b/packages/sanity/src/core/form/studio/assetSource/image/AssetThumb.tsx @@ -88,7 +88,7 @@ const MenuContainer = styled.div` export const AssetThumb = memo(function AssetThumb(props: AssetProps) { const versionedClient = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS) const toast = useToast() - const deleteRef$ = useRef<Subscription>() + const deleteRef$ = useRef<Subscription>(undefined) const {asset, onClick, onKeyPress, onDeleteFinished, isSelected} = props const [showUsageDialog, setShowUsageDialog] = useState(false) const [showDeleteDialog, setShowDeleteDialog] = useState(false) diff --git a/packages/sanity/src/core/form/studio/assetSource/shared/DefaultSource.tsx b/packages/sanity/src/core/form/studio/assetSource/shared/DefaultSource.tsx index bd091673972..d5c2825c36c 100644 --- a/packages/sanity/src/core/form/studio/assetSource/shared/DefaultSource.tsx +++ b/packages/sanity/src/core/form/studio/assetSource/shared/DefaultSource.tsx @@ -108,7 +108,7 @@ const DefaultAssetSource = function DefaultAssetSource( const [_elementId] = useState(() => `default-asset-source-${uniqueId()}`) const currentPageNumber = useRef(0) const {t} = useTranslation() - const fetch$ = useRef<Subscription>() + const fetch$ = useRef<Subscription>(undefined) const [assets, setAssets] = useState<Asset[]>([]) const [isLastPage, setIsLastPage] = useState(false) const [hasResetAutoFocus, setHasResetFocus] = useState(false) diff --git a/packages/sanity/src/core/form/studio/contexts/reviewChanges/ReviewChangesProvider.tsx b/packages/sanity/src/core/form/studio/contexts/reviewChanges/ReviewChangesProvider.tsx index ffe37c799d1..67a75b28685 100644 --- a/packages/sanity/src/core/form/studio/contexts/reviewChanges/ReviewChangesProvider.tsx +++ b/packages/sanity/src/core/form/studio/contexts/reviewChanges/ReviewChangesProvider.tsx @@ -9,7 +9,7 @@ import {type ReviewChangesContextValue} from './types' export function ReviewChangesContextProvider(props: { children?: ReactNode changesOpen: boolean -}): ReactElement { +}): ReactElement<any> { const {children, changesOpen} = props const contextValue: ReviewChangesContextValue = useMemo(() => ({changesOpen}), [changesOpen]) diff --git a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuButtonStory.tsx b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuButtonStory.tsx index bd75820a73a..e576beb36bf 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuButtonStory.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuButtonStory.tsx @@ -47,7 +47,7 @@ const ITEM: TreeEditingBreadcrumb = { })), } -export default function TreeEditingBreadcrumbsMenuButtonStory(): JSX.Element { +export default function TreeEditingBreadcrumbsMenuButtonStory(): React.JSX.Element { const [selectedPath, setSelectedPath] = useState<Path>(['first-item']) return ( diff --git a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuStory.tsx b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuStory.tsx index 41a53a44599..e92478da333 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuStory.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsMenuStory.tsx @@ -55,7 +55,7 @@ const items: TreeEditingBreadcrumb[] = [ }, ] -export default function TreeEditingBreadcrumbsMenuStory(): JSX.Element { +export default function TreeEditingBreadcrumbsMenuStory(): React.JSX.Element { const [selectedPath, setSelectedPath] = useState<Path>(['second-item']) return ( diff --git a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsStory.tsx b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsStory.tsx index 03c17716256..d2400211983 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsStory.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingBreadcrumbsStory.tsx @@ -118,7 +118,7 @@ const DOCUMENT_VALUE = { ], } -export default function TreeEditingBreadcrumbsStory(): JSX.Element { +export default function TreeEditingBreadcrumbsStory(): React.JSX.Element { const [selectedPath, setSelectedPath] = useState<Path>(['myArrayOfObjects', {_key: 'item-1'}]) const {menuItems} = useMemo((): TreeEditingState => { diff --git a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingLayoutStory.tsx b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingLayoutStory.tsx index 25ed4877ab9..7866163e92b 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingLayoutStory.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingLayoutStory.tsx @@ -118,7 +118,7 @@ const DOCUMENT_VALUE = { ], } -export default function TreeEditingLayoutStory(): JSX.Element { +export default function TreeEditingLayoutStory(): React.JSX.Element { const [selectedPath, setSelectedPath] = useState<Path>(['myArrayOfObjects', {_key: 'first-item'}]) const state = useMemo(() => { diff --git a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingMenuStory.tsx b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingMenuStory.tsx index 4b3fabb5e5e..682c16c4604 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingMenuStory.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/__workshop__/TreeEditingMenuStory.tsx @@ -118,7 +118,7 @@ const DOCUMENT_VALUE = { ], } -export default function TreeEditingMenuStory(): JSX.Element { +export default function TreeEditingMenuStory(): React.JSX.Element { const [selectedPath, setSelectedPath] = useState<Path>(['myArrayOfObjects', {_key: 'first-item'}]) const {menuItems} = useMemo((): TreeEditingState => { diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/TreeEditingDialog.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/TreeEditingDialog.tsx index a0f24944ca5..3a85abc7cc0 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/TreeEditingDialog.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/TreeEditingDialog.tsx @@ -66,7 +66,7 @@ interface TreeEditingDialogProps { schemaType: ObjectSchemaType } -export function TreeEditingDialog(props: TreeEditingDialogProps): JSX.Element | null { +export function TreeEditingDialog(props: TreeEditingDialogProps): React.JSX.Element | null { const {onPathFocus, onPathOpen, openPath, rootInputProps, schemaType} = props const {value} = rootInputProps const {t} = useTranslation() diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbs.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbs.tsx index a7d179705ef..6e2aad4805e 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbs.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbs.tsx @@ -121,7 +121,9 @@ interface TreeEditingBreadcrumbsProps { selectedPath: Path } -export function TreeEditingBreadcrumbs(props: TreeEditingBreadcrumbsProps): JSX.Element | null { +export function TreeEditingBreadcrumbs( + props: TreeEditingBreadcrumbsProps, +): React.JSX.Element | null { const {items: itemsProp = EMPTY_ARRAY, onPathSelect, selectedPath} = props const [rootElement, setRootElement] = useState<HTMLDivElement | null>(null) diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenu.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenu.tsx index 97318d080d6..b29b0637f8d 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenu.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenu.tsx @@ -23,10 +23,10 @@ interface BreadcrumbsItemProps { selected: boolean isFirst: boolean onPathSelect: (path: Path) => void - renderMenuItemTitle: (value: PreviewValue) => JSX.Element + renderMenuItemTitle: (value: PreviewValue) => React.JSX.Element } -function BreadcrumbsItem(props: BreadcrumbsItemProps): JSX.Element { +function BreadcrumbsItem(props: BreadcrumbsItemProps): React.JSX.Element { const {item, onPathSelect, selected, isFirst, renderMenuItemTitle} = props const {value} = useValuePreviewWithFallback({ @@ -67,7 +67,9 @@ interface TreeEditingBreadcrumbsMenuProps { selectedPath: Path } -export function TreeEditingBreadcrumbsMenu(props: TreeEditingBreadcrumbsMenuProps): JSX.Element { +export function TreeEditingBreadcrumbsMenu( + props: TreeEditingBreadcrumbsMenuProps, +): React.JSX.Element { const {items, onPathSelect, selectedPath, collapsed = false} = props const {t} = useTranslation() diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenuButton.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenuButton.tsx index 13847a408ee..0f3a68bf7db 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenuButton.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/breadcrumbs/TreeEditingBreadcrumbsMenuButton.tsx @@ -57,7 +57,7 @@ const StyledPopover = styled(Popover)(() => { }) interface TreeEditingBreadcrumbsMenuButtonProps { - button: ReactElement + button: ReactElement<any> collapsed?: boolean items: TreeEditingBreadcrumb[] menuTitle?: string @@ -68,7 +68,7 @@ interface TreeEditingBreadcrumbsMenuButtonProps { export function TreeEditingBreadcrumbsMenuButton( props: TreeEditingBreadcrumbsMenuButtonProps, -): JSX.Element { +): React.JSX.Element { const { button, collapsed = false, diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/layout/TreeEditingLayout.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/layout/TreeEditingLayout.tsx index 23ea2c54ffa..a478ed6f612 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/layout/TreeEditingLayout.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/layout/TreeEditingLayout.tsx @@ -24,7 +24,7 @@ interface TreeEditingLayoutProps { export const TreeEditingLayout = memo(function TreeEditingLayout( props: TreeEditingLayoutProps, -): JSX.Element { +): React.JSX.Element { const { breadcrumbs, children, diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/layout/resizer/Resizable.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/layout/resizer/Resizable.tsx index ef695fc4e1d..7698192d714 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/layout/resizer/Resizable.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/layout/resizer/Resizable.tsx @@ -21,7 +21,7 @@ export function Resizable( ) { const {as: forwardedAs, children, minWidth, maxWidth, initialWidth, ...restProps} = props const [element, setElement] = useState<HTMLDivElement | null>(null) - const elementWidthRef = useRef<number>() + const elementWidthRef = useRef<number>(undefined) const [targetWidth, setTargetWidth] = useState<number>(initialWidth) const handleResizeStart = useCallback(() => { diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearch.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearch.tsx index a096c1b36b1..90f7fe9bca5 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearch.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearch.tsx @@ -57,7 +57,7 @@ interface TreeEditingSearchProps { onPathSelect: (path: Path) => void } -export function TreeEditingSearch(props: TreeEditingSearchProps): JSX.Element { +export function TreeEditingSearch(props: TreeEditingSearchProps): React.JSX.Element { const {items, onPathSelect} = props const [textInputElement, setTextInputElement] = useState<HTMLInputElement | null>(null) diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearchMenu.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearchMenu.tsx index faf6b4dc633..adf1379b70a 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearchMenu.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/search/TreeEditingSearchMenu.tsx @@ -24,7 +24,7 @@ interface ResultItemProps { isFirst: boolean } -function ResultItem(props: ResultItemProps): JSX.Element { +function ResultItem(props: ResultItemProps): React.JSX.Element { const {item, onPathSelect, isFirst} = props const {value} = useValuePreviewWithFallback({ @@ -61,7 +61,7 @@ interface TreeEditingSearchMenuProps { textInputElement: HTMLInputElement | null } -export function TreeEditingSearchMenu(props: TreeEditingSearchMenuProps): JSX.Element { +export function TreeEditingSearchMenu(props: TreeEditingSearchMenuProps): React.JSX.Element { const {items, onPathSelect, textInputElement} = props const {t} = useTranslation() diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenu.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenu.tsx index 7856f5af523..47a8c4dee63 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenu.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenu.tsx @@ -15,7 +15,7 @@ interface TreeEditingMenuProps { export const TreeEditingMenu = memo(function TreeEditingMenu( props: TreeEditingMenuProps, -): JSX.Element { +): React.JSX.Element { const {items, onPathSelect, selectedPath} = props return ( diff --git a/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenuItem.tsx b/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenuItem.tsx index e78eaa26b97..a58bd16435e 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenuItem.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/components/tree-menu/TreeEditingMenuItem.tsx @@ -116,7 +116,7 @@ interface TreeEditingMenuItemProps { siblingHasChildren?: boolean } -export function TreeEditingMenuItem(props: TreeEditingMenuItemProps): JSX.Element { +export function TreeEditingMenuItem(props: TreeEditingMenuItemProps): React.JSX.Element { const {item, onPathSelect, selectedPath, siblingHasChildren} = props const {children} = item const hasChildren = children && children.length > 0 diff --git a/packages/sanity/src/core/form/studio/tree-editing/context/enabled/TreeEditingEnabledProvider.tsx b/packages/sanity/src/core/form/studio/tree-editing/context/enabled/TreeEditingEnabledProvider.tsx index a2e30c93669..4dd20733199 100644 --- a/packages/sanity/src/core/form/studio/tree-editing/context/enabled/TreeEditingEnabledProvider.tsx +++ b/packages/sanity/src/core/form/studio/tree-editing/context/enabled/TreeEditingEnabledProvider.tsx @@ -8,7 +8,9 @@ interface TreeEditingEnabledProviderProps { legacyEditing?: boolean } -export function TreeEditingEnabledProvider(props: TreeEditingEnabledProviderProps): JSX.Element { +export function TreeEditingEnabledProvider( + props: TreeEditingEnabledProviderProps, +): React.JSX.Element { const {children, legacyEditing: legacyEditingProp} = props const parentContextValue = useTreeEditingEnabled() diff --git a/packages/sanity/src/core/form/types/blockProps.ts b/packages/sanity/src/core/form/types/blockProps.ts index f2074956fe0..23ea79e65a4 100644 --- a/packages/sanity/src/core/form/types/blockProps.ts +++ b/packages/sanity/src/core/form/types/blockProps.ts @@ -34,7 +34,7 @@ export interface BlockDecoratorProps { /** * The span node as rendered without the decorator. */ - children: ReactElement + children: ReactElement<any> /** * If the span node currently is focused by the user. */ @@ -43,7 +43,7 @@ export interface BlockDecoratorProps { * The default render function for this decorator, * some decorators are proved by default and has a default rendering. */ - renderDefault: (props: BlockDecoratorProps) => ReactElement + renderDefault: (props: BlockDecoratorProps) => ReactElement<any> /** * The decorator schema type. Icon can be found here. */ @@ -76,7 +76,7 @@ export interface BlockStyleProps { /** * The block as rendered without this style. */ - children: ReactElement + children: ReactElement<any> /** * If the block currently has focus in the text editor. */ @@ -84,7 +84,7 @@ export interface BlockStyleProps { /** * The default rendering function for this style. */ - renderDefault: (props: BlockStyleProps) => ReactElement + renderDefault: (props: BlockStyleProps) => ReactElement<any> /** * The schema type for this style. */ @@ -116,7 +116,7 @@ export interface BlockListItemProps { /** * The block rendered without the list style. */ - children: ReactElement + children: ReactElement<any> /** * If the block currently is focused by the user. */ @@ -129,7 +129,7 @@ export interface BlockListItemProps { * The default function for rendering this as a list item. Some list types are built in and * will have a default rendering. */ - renderDefault: (props: BlockListItemProps) => ReactElement + renderDefault: (props: BlockListItemProps) => ReactElement<any> /** * The schema type for this list type. Icon can be found here. */ @@ -273,7 +273,7 @@ export interface BlockAnnotationProps { /** * Plugin chain render callback. */ - renderDefault: (props: BlockAnnotationProps) => ReactElement + renderDefault: (props: BlockAnnotationProps) => ReactElement<any> /** * Plugin chain render callback. */ @@ -305,7 +305,7 @@ export interface BlockAnnotationProps { /** * React element of the text that is being annotated. */ - textElement: ReactElement + textElement: ReactElement<any> /** * Form validation for the annotation object. */ @@ -397,7 +397,7 @@ export interface BlockProps { /** * Plugin chain render callback (default rendering function of the block). */ - renderDefault: (props: BlockProps) => ReactElement + renderDefault: (props: BlockProps) => ReactElement<any> /** * Plugin chain render callback. */ diff --git a/packages/sanity/src/core/form/types/fieldProps.ts b/packages/sanity/src/core/form/types/fieldProps.ts index e530df7bc60..63144dbd14e 100644 --- a/packages/sanity/src/core/form/types/fieldProps.ts +++ b/packages/sanity/src/core/form/types/fieldProps.ts @@ -60,7 +60,7 @@ export interface BaseFieldProps { index: number changed: boolean children: ReactNode - renderDefault: (props: FieldProps) => ReactElement + renderDefault: (props: FieldProps) => ReactElement<any> } /** diff --git a/packages/sanity/src/core/form/types/inputProps.ts b/packages/sanity/src/core/form/types/inputProps.ts index 49dbf3eb8ca..af08ddd20db 100644 --- a/packages/sanity/src/core/form/types/inputProps.ts +++ b/packages/sanity/src/core/form/types/inputProps.ts @@ -72,7 +72,7 @@ export interface OnPathFocusPayload { * @hidden * @public */ export interface BaseInputProps { - renderDefault: (props: InputProps) => ReactElement + renderDefault: (props: InputProps) => ReactElement<any> } /** @@ -579,7 +579,7 @@ export interface PortableTextInputProps * @hidden * @beta */ - renderEditable?: (props: RenderPortableTextInputEditableProps) => JSX.Element + renderEditable?: (props: RenderPortableTextInputEditableProps) => React.JSX.Element /** * Array of {@link RangeDecoration} that can be used to decorate the content. */ diff --git a/packages/sanity/src/core/form/types/itemProps.ts b/packages/sanity/src/core/form/types/itemProps.ts index 7496a2d7d4a..bf42e0012f6 100644 --- a/packages/sanity/src/core/form/types/itemProps.ts +++ b/packages/sanity/src/core/form/types/itemProps.ts @@ -87,7 +87,7 @@ export interface BaseItemProps<T> { presence: FormNodePresence[] /** The function to call to render the default item. See {@link ItemProps} */ - renderDefault: (props: ItemProps) => ReactElement + renderDefault: (props: ItemProps) => ReactElement<any> } /** diff --git a/packages/sanity/src/core/hooks/__tests__/useFormattedDuration.test.tsx b/packages/sanity/src/core/hooks/__tests__/useFormattedDuration.test.tsx index 7eec8508648..7d1c822c8e1 100644 --- a/packages/sanity/src/core/hooks/__tests__/useFormattedDuration.test.tsx +++ b/packages/sanity/src/core/hooks/__tests__/useFormattedDuration.test.tsx @@ -16,7 +16,7 @@ describe('useFormattedDuration', () => { i18n: {bundles: [studioDefaultLocaleResources]}, }) - const wrapper = ({children}: {children: ReactElement}) => ( + const wrapper = ({children}: {children: ReactElement<any>}) => ( <ThemeProvider theme={studioTheme}> <LocaleProviderBase locales={[usEnglishLocale]} diff --git a/packages/sanity/src/core/hooks/__tests__/useRelativeTime.test.tsx b/packages/sanity/src/core/hooks/__tests__/useRelativeTime.test.tsx index bf2172ececa..451ccaab952 100644 --- a/packages/sanity/src/core/hooks/__tests__/useRelativeTime.test.tsx +++ b/packages/sanity/src/core/hooks/__tests__/useRelativeTime.test.tsx @@ -17,7 +17,7 @@ describe('useRelativeTime', () => { i18n: {bundles: [studioDefaultLocaleResources]}, }) - const wrapper = ({children}: {children: ReactElement}) => ( + const wrapper = ({children}: {children: ReactElement<any>}) => ( <ThemeProvider theme={studioTheme}> <LocaleProviderBase locales={[usEnglishLocale]} diff --git a/packages/sanity/src/core/hooks/__tests__/useUnitFormatter.test.tsx b/packages/sanity/src/core/hooks/__tests__/useUnitFormatter.test.tsx index e7027869a6a..dad913c72e3 100644 --- a/packages/sanity/src/core/hooks/__tests__/useUnitFormatter.test.tsx +++ b/packages/sanity/src/core/hooks/__tests__/useUnitFormatter.test.tsx @@ -16,7 +16,7 @@ describe('useUnitFormatter', () => { i18n: {bundles: [studioDefaultLocaleResources]}, }) - const wrapper = ({children}: {children: ReactElement}) => ( + const wrapper = ({children}: {children: ReactElement<any>}) => ( <ThemeProvider theme={studioTheme}> <LocaleProviderBase locales={[ diff --git a/packages/sanity/src/core/i18n/Translate.tsx b/packages/sanity/src/core/i18n/Translate.tsx index 218d312f32e..efe5316622e 100644 --- a/packages/sanity/src/core/i18n/Translate.tsx +++ b/packages/sanity/src/core/i18n/Translate.tsx @@ -34,7 +34,7 @@ type FormatterFns = {list: (value: Iterable<string>) => string} */ export type TranslateComponentMap = Record< string, - ComponentType<{children?: ReactNode}> | keyof JSX.IntrinsicElements + ComponentType<{children?: ReactNode}> | keyof React.JSX.IntrinsicElements > /** diff --git a/packages/sanity/src/core/presence/PresenceTooltip.tsx b/packages/sanity/src/core/presence/PresenceTooltip.tsx index 9a5b6ec00e0..2a287cbbe85 100644 --- a/packages/sanity/src/core/presence/PresenceTooltip.tsx +++ b/packages/sanity/src/core/presence/PresenceTooltip.tsx @@ -6,7 +6,7 @@ import {UserAvatar} from '../components/userAvatar' import {type FormNodePresence} from './types' interface PresenceTooltipProps { - children?: ReactElement + children?: ReactElement<any> items: FormNodePresence[] } diff --git a/packages/sanity/src/core/presence/overlay/StickyOverlay.tsx b/packages/sanity/src/core/presence/overlay/StickyOverlay.tsx index fadb413937c..792859a2a05 100644 --- a/packages/sanity/src/core/presence/overlay/StickyOverlay.tsx +++ b/packages/sanity/src/core/presence/overlay/StickyOverlay.tsx @@ -327,7 +327,7 @@ function PresenceInside(props: { ) } -const PassThrough = (props: {children: ReactElement; [prop: string]: any}) => props.children +const PassThrough = (props: {children: ReactElement<any>; [prop: string]: any}) => props.children const DebugValue = DEBUG ? function DebugValue(props: any) { diff --git a/packages/sanity/src/core/preview/components/PreviewLoader.tsx b/packages/sanity/src/core/preview/components/PreviewLoader.tsx index e4689fa83c0..13bc2fe7d1e 100644 --- a/packages/sanity/src/core/preview/components/PreviewLoader.tsx +++ b/packages/sanity/src/core/preview/components/PreviewLoader.tsx @@ -20,7 +20,7 @@ export function PreviewLoader( props: RenderPreviewCallbackProps & { component: ComponentType<Omit<PreviewProps, 'renderDefault'>> }, -): ReactElement { +): ReactElement<any> { const { layout, value, diff --git a/packages/sanity/src/core/preview/components/SanityDefaultPreview.tsx b/packages/sanity/src/core/preview/components/SanityDefaultPreview.tsx index 7d9c3fa3126..d2c8b1ba87e 100644 --- a/packages/sanity/src/core/preview/components/SanityDefaultPreview.tsx +++ b/packages/sanity/src/core/preview/components/SanityDefaultPreview.tsx @@ -39,7 +39,7 @@ export interface SanityDefaultPreviewProps extends Omit<PreviewProps, 'renderDef * */ export const SanityDefaultPreview = memo(function SanityDefaultPreview( props: SanityDefaultPreviewProps, -): ReactElement { +): ReactElement<any> { const {icon: Icon, layout, media: mediaProp, imageUrl, title, tooltip, ...restProps} = props const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS) diff --git a/packages/sanity/src/core/scheduledPublishing/components/scheduleItem/PreviewWrapper.tsx b/packages/sanity/src/core/scheduledPublishing/components/scheduleItem/PreviewWrapper.tsx index abba5514f78..d598125076e 100644 --- a/packages/sanity/src/core/scheduledPublishing/components/scheduleItem/PreviewWrapper.tsx +++ b/packages/sanity/src/core/scheduledPublishing/components/scheduleItem/PreviewWrapper.tsx @@ -31,7 +31,7 @@ interface Props { children?: ReactNode contextMenu?: ReactNode // eslint-disable-next-line no-undef - linkComponent?: ElementType | keyof JSX.IntrinsicElements + linkComponent?: ElementType | keyof React.JSX.IntrinsicElements onClick?: () => void previewState?: PaneItemPreviewState publishedDocumentId?: string diff --git a/packages/sanity/src/core/scheduledPublishing/tool/Tool.tsx b/packages/sanity/src/core/scheduledPublishing/tool/Tool.tsx index cc0a5aaab15..1ca4f28e41b 100644 --- a/packages/sanity/src/core/scheduledPublishing/tool/Tool.tsx +++ b/packages/sanity/src/core/scheduledPublishing/tool/Tool.tsx @@ -35,7 +35,7 @@ export default function Tool() { const {error, isInitialLoading, schedules = NO_SCHEDULE} = usePollSchedules() const {enabled} = useScheduledPublishingEnabled() - const lastScheduleState = useRef<ScheduleState | undefined>() + const lastScheduleState = useRef<ScheduleState | undefined>(undefined) const scheduleState: ScheduleState = router.state.state as ScheduleState const selectedDate = router.state.date diff --git a/packages/sanity/src/core/studio/Studio.tsx b/packages/sanity/src/core/studio/Studio.tsx index aeff6e95668..5a6dfb2aa2c 100644 --- a/packages/sanity/src/core/studio/Studio.tsx +++ b/packages/sanity/src/core/studio/Studio.tsx @@ -93,7 +93,7 @@ export interface StudioProps { /** * @hidden * @beta */ -export function Studio(props: StudioProps): ReactElement { +export function Studio(props: StudioProps): ReactElement<any> { const { basePath, config, diff --git a/packages/sanity/src/core/studio/colorScheme.tsx b/packages/sanity/src/core/studio/colorScheme.tsx index c37fd87902d..8a9202ff6be 100644 --- a/packages/sanity/src/core/studio/colorScheme.tsx +++ b/packages/sanity/src/core/studio/colorScheme.tsx @@ -113,7 +113,7 @@ export function ColorSchemeCustomProvider({ scheme, }: Pick<ColorSchemeProviderProps, 'children' | 'onSchemeChange'> & { scheme: StudioThemeColorSchemeKey -}): JSX.Element { +}): React.JSX.Element { return ( <ColorSchemeSetValueContext.Provider value={typeof onSchemeChange === 'function' ? onSchemeChange : false} diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx index 556aa711fe7..da73c8b8e1e 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/filters/addFilter/items/FilterTooltip.tsx @@ -14,7 +14,7 @@ import {getSchemaField} from '../../../../utils/getSchemaField' import {sanitizeFieldValue} from '../../../../utils/sanitizeField' interface FilterTooltipProps { - children: ReactElement + children: ReactElement<any> fieldDefinition?: SearchFieldDefinition filterDefinition: SearchFilterDefinition visible?: boolean diff --git a/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/reference/ReferenceAutocomplete.tsx b/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/reference/ReferenceAutocomplete.tsx index f01caf53509..d4ae140754b 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/reference/ReferenceAutocomplete.tsx +++ b/packages/sanity/src/core/studio/components/navbar/search/components/filters/filter/inputs/reference/ReferenceAutocomplete.tsx @@ -26,7 +26,7 @@ import {SearchResultItem} from '../../../../searchResults/item/SearchResultItem' type AutocompleteSearchHit = {value: string} & SearchHit interface PopoverContentProps { - content: ReactElement | null + content: ReactElement<any> | null hidden: boolean onMouseEnter: () => void onMouseLeave: () => void diff --git a/packages/sanity/src/core/studio/components/navbar/search/utils/sanitizeField.ts b/packages/sanity/src/core/studio/components/navbar/search/utils/sanitizeField.ts index 32f7185244f..3487f1a36d1 100644 --- a/packages/sanity/src/core/studio/components/navbar/search/utils/sanitizeField.ts +++ b/packages/sanity/src/core/studio/components/navbar/search/utils/sanitizeField.ts @@ -5,7 +5,7 @@ import {renderToString} from 'react-dom/server' * Convert a field value to a string (if it's a React element) and remove HTML tags. * If the field value is a string, pass through as-is. */ -export function sanitizeFieldValue(name: string | ReactElement): string { +export function sanitizeFieldValue(name: string | ReactElement<any>): string { if (isValidElement(name)) { return stripHtmlTags(renderToString(name)) } diff --git a/packages/sanity/src/core/studio/studioAnnouncements/Divider.tsx b/packages/sanity/src/core/studio/studioAnnouncements/Divider.tsx index bf94a2fbd4c..7ae01bc3d1a 100644 --- a/packages/sanity/src/core/studio/studioAnnouncements/Divider.tsx +++ b/packages/sanity/src/core/studio/studioAnnouncements/Divider.tsx @@ -13,7 +13,7 @@ const Hr = styled.hr<{$show: boolean}>` ` interface DividerProps { - parentRef: React.RefObject<HTMLDivElement> + parentRef: React.RefObject<HTMLDivElement | null> } /** @@ -28,7 +28,7 @@ const DIVIDER_FADE_THRESHOLD = '-60px 0px 0px 0px' /** * A divider that fades when reaching the top of the parent. */ -export function Divider({parentRef}: DividerProps): JSX.Element { +export function Divider({parentRef}: DividerProps): React.JSX.Element { const itemRef = useRef<HTMLHRElement | null>(null) const [show, setShow] = useState(true) diff --git a/packages/sanity/src/core/studio/studioAnnouncements/StudioAnnouncementsDialog.tsx b/packages/sanity/src/core/studio/studioAnnouncements/StudioAnnouncementsDialog.tsx index 9ae088476bc..4c1313b7c8a 100644 --- a/packages/sanity/src/core/studio/studioAnnouncements/StudioAnnouncementsDialog.tsx +++ b/packages/sanity/src/core/studio/studioAnnouncements/StudioAnnouncementsDialog.tsx @@ -48,7 +48,7 @@ interface AnnouncementProps { announcement: StudioAnnouncementDocument mode: DialogMode isFirst: boolean - parentRef: React.RefObject<HTMLDivElement> + parentRef: React.RefObject<HTMLDivElement | null> } /** diff --git a/packages/sanity/src/core/studio/workspace.tsx b/packages/sanity/src/core/studio/workspace.tsx index 481c645205f..f15c0d72d78 100644 --- a/packages/sanity/src/core/studio/workspace.tsx +++ b/packages/sanity/src/core/studio/workspace.tsx @@ -1,4 +1,4 @@ -import {type ReactChild, useContext} from 'react' +import {useContext} from 'react' import {WorkspaceContext} from 'sanity/_singletons' import {type Workspace} from '../config' @@ -6,11 +6,14 @@ import {type Workspace} from '../config' /** @internal */ export interface WorkspaceProviderProps { workspace: Workspace - children?: ReactChild + children: React.ReactNode } /** @internal */ -export function WorkspaceProvider({children, workspace}: WorkspaceProviderProps) { +export function WorkspaceProvider({ + children, + workspace, +}: WorkspaceProviderProps): React.JSX.Element { return <WorkspaceContext.Provider value={workspace}>{children}</WorkspaceContext.Provider> } diff --git a/packages/sanity/src/core/tasks/components/activity/helpers/index.tsx b/packages/sanity/src/core/tasks/components/activity/helpers/index.tsx index e9438216fe6..3abfc95f75f 100644 --- a/packages/sanity/src/core/tasks/components/activity/helpers/index.tsx +++ b/packages/sanity/src/core/tasks/components/activity/helpers/index.tsx @@ -105,8 +105,8 @@ function TargetContentChange({target}: {target: TaskTarget}) { export function getChangeDetails(activity: FieldChange): { text: string - icon: ReactElement - changeTo?: ReactElement + icon: ReactElement<any> + changeTo?: ReactElement<any> } { switch (activity.field) { case 'status': { diff --git a/packages/sanity/src/core/tasks/components/form/fields/assignee/AssigneeSelectionMenu.tsx b/packages/sanity/src/core/tasks/components/form/fields/assignee/AssigneeSelectionMenu.tsx index 2c3714be450..d0b75d6ac3c 100644 --- a/packages/sanity/src/core/tasks/components/form/fields/assignee/AssigneeSelectionMenu.tsx +++ b/packages/sanity/src/core/tasks/components/form/fields/assignee/AssigneeSelectionMenu.tsx @@ -182,7 +182,7 @@ function MentionsMenu({onSelect, value = ''}: {onSelect: SelectItemHandler; valu export function AssigneeSelectionMenu(props: { onSelect: (userId: string) => void - menuButton: React.ReactElement + menuButton: React.ReactElement<any> value?: string }) { const {onSelect, menuButton, value} = props diff --git a/packages/sanity/src/core/tasks/context/isLastPane/IsLastPaneProvider.tsx b/packages/sanity/src/core/tasks/context/isLastPane/IsLastPaneProvider.tsx index 2bdcc980123..c4cf9901000 100644 --- a/packages/sanity/src/core/tasks/context/isLastPane/IsLastPaneProvider.tsx +++ b/packages/sanity/src/core/tasks/context/isLastPane/IsLastPaneProvider.tsx @@ -9,6 +9,9 @@ interface IsLastPaneProviderProps { * @internal * @hidden */ -export function IsLastPaneProvider({children, isLastPane}: IsLastPaneProviderProps): JSX.Element { +export function IsLastPaneProvider({ + children, + isLastPane, +}: IsLastPaneProviderProps): React.JSX.Element { return <IsLastPaneContext.Provider value={isLastPane}>{children}</IsLastPaneContext.Provider> } diff --git a/packages/sanity/src/core/templates/types.ts b/packages/sanity/src/core/templates/types.ts index 91469f8a52f..699b18aa5ac 100644 --- a/packages/sanity/src/core/templates/types.ts +++ b/packages/sanity/src/core/templates/types.ts @@ -179,7 +179,7 @@ export interface TemplateItem { * React icon for the item, if any. * Defaults to the icon for the associated template. */ - icon?: ElementType | ReactElement + icon?: ElementType | ReactElement<any> /** * Experimental: not fully supported yet diff --git a/packages/sanity/src/core/user-color/provider.tsx b/packages/sanity/src/core/user-color/provider.tsx index f306b1dbe07..70b61425e46 100644 --- a/packages/sanity/src/core/user-color/provider.tsx +++ b/packages/sanity/src/core/user-color/provider.tsx @@ -15,7 +15,7 @@ export interface UserColorManagerProviderProps { export function UserColorManagerProvider({ children, manager: managerFromProps, -}: UserColorManagerProviderProps): ReactElement { +}: UserColorManagerProviderProps): ReactElement<any> { const scheme = useColorSchemeValue() const manager = useMemo(() => { diff --git a/packages/sanity/src/router/RouteScope.tsx b/packages/sanity/src/router/RouteScope.tsx index f9d9bece7d3..5059981bea7 100644 --- a/packages/sanity/src/router/RouteScope.tsx +++ b/packages/sanity/src/router/RouteScope.tsx @@ -63,7 +63,7 @@ export interface RouteScopeProps { * } * ``` */ -export const RouteScope = function RouteScope(props: RouteScopeProps): ReactElement { +export const RouteScope = function RouteScope(props: RouteScopeProps): ReactElement<any> { const {children, scope, __unsafe_disableScopedSearchParams} = props const parentRouter = useRouter() const {resolvePathFromState: parent_resolvePathFromState, navigate: parent_navigate} = diff --git a/packages/sanity/src/router/RouterProvider.tsx b/packages/sanity/src/router/RouterProvider.tsx index d21166e7dfd..211e55c677e 100644 --- a/packages/sanity/src/router/RouterProvider.tsx +++ b/packages/sanity/src/router/RouterProvider.tsx @@ -77,7 +77,7 @@ export interface RouterProviderProps { * * @public */ -export function RouterProvider(props: RouterProviderProps): ReactElement { +export function RouterProvider(props: RouterProviderProps): ReactElement<any> { const {onNavigate, router: routerProp, state} = props const resolveIntentLink = useCallback( diff --git a/packages/sanity/src/router/withRouter.tsx b/packages/sanity/src/router/withRouter.tsx index 628b7c3e1ac..9914b020130 100644 --- a/packages/sanity/src/router/withRouter.tsx +++ b/packages/sanity/src/router/withRouter.tsx @@ -50,7 +50,7 @@ export interface WithRouterProps { /** * A function that renders the wrapped component with the `router` object as a parameter. */ - children: (router: RouterContextValue) => ReactElement + children: (router: RouterContextValue) => ReactElement<any> } /** diff --git a/packages/sanity/src/structure/StructureToolProvider.tsx b/packages/sanity/src/structure/StructureToolProvider.tsx index 43b7667647c..c697f92e667 100644 --- a/packages/sanity/src/structure/StructureToolProvider.tsx +++ b/packages/sanity/src/structure/StructureToolProvider.tsx @@ -21,7 +21,7 @@ export function StructureToolProvider({ defaultDocumentNode, structure: resolveStructure, children, -}: StructureToolProviderProps): ReactElement { +}: StructureToolProviderProps): ReactElement<any> { const [layoutCollapsed, setLayoutCollapsed] = useState(false) const source = useSource() const configContext = useConfigContextFromSource(source) diff --git a/packages/sanity/src/structure/components/Delay.tsx b/packages/sanity/src/structure/components/Delay.tsx index dc06f2f9224..628610a1aeb 100644 --- a/packages/sanity/src/structure/components/Delay.tsx +++ b/packages/sanity/src/structure/components/Delay.tsx @@ -4,9 +4,9 @@ export function Delay({ children, ms = 0, }: { - children?: ReactElement | (() => ReactElement) + children?: ReactElement<any> | (() => ReactElement<any>) ms?: number -}): ReactElement { +}): ReactElement<any> { const [ready, setReady] = useState(ms <= 0) useEffect(() => { diff --git a/packages/sanity/src/structure/components/pane/PaneContent.tsx b/packages/sanity/src/structure/components/pane/PaneContent.tsx index db7a0b2088b..19f262872e6 100644 --- a/packages/sanity/src/structure/components/pane/PaneContent.tsx +++ b/packages/sanity/src/structure/components/pane/PaneContent.tsx @@ -6,7 +6,7 @@ import {usePane} from './usePane' import {usePaneLayout} from './usePaneLayout' interface PaneContentProps { - as?: ElementType | keyof JSX.IntrinsicElements + as?: ElementType | keyof React.JSX.IntrinsicElements overflow?: BoxOverflow padding?: number | number[] } diff --git a/packages/sanity/src/structure/panes/document/documentInspector/DocumentInspectorPanel.tsx b/packages/sanity/src/structure/panes/document/documentInspector/DocumentInspectorPanel.tsx index 8dec4b1cbb7..7e3cbd89575 100644 --- a/packages/sanity/src/structure/panes/document/documentInspector/DocumentInspectorPanel.tsx +++ b/packages/sanity/src/structure/panes/document/documentInspector/DocumentInspectorPanel.tsx @@ -13,7 +13,9 @@ interface DocumentInspectorPanelProps { flex?: number | number[] } -export function DocumentInspectorPanel(props: DocumentInspectorPanelProps): ReactElement | null { +export function DocumentInspectorPanel( + props: DocumentInspectorPanelProps, +): ReactElement<any> | null { const {documentId, documentType, flex} = props const {collapsed} = usePane() const {closeInspector, inspector} = useDocumentPane() diff --git a/packages/sanity/src/structure/panes/document/documentInspector/Resizable.tsx b/packages/sanity/src/structure/panes/document/documentInspector/Resizable.tsx index 07834447396..d6edcd2b3fc 100644 --- a/packages/sanity/src/structure/panes/document/documentInspector/Resizable.tsx +++ b/packages/sanity/src/structure/panes/document/documentInspector/Resizable.tsx @@ -20,7 +20,7 @@ export function Resizable( ) { const {as: forwardedAs, children, minWidth, maxWidth, ...restProps} = props const [element, setElement] = useState<HTMLDivElement | null>(null) - const elementWidthRef = useRef<number>() + const elementWidthRef = useRef<number>(undefined) const [targetWidth, setTargetWidth] = useState<number>() const handleResizeStart = useCallback(() => { diff --git a/packages/sanity/src/structure/panes/document/documentPanel/banners/Banner.tsx b/packages/sanity/src/structure/panes/document/documentPanel/banners/Banner.tsx index f6b8a70f1fe..869696819c8 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/banners/Banner.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/banners/Banner.tsx @@ -1,11 +1,11 @@ import {type ButtonMode, type ButtonTone, Card, type CardTone, Flex, Text} from '@sanity/ui' -import {type ComponentType, type ElementType, type JSX, type ReactNode} from 'react' +import {type ComponentType, type ElementType, type ReactNode} from 'react' import {Button} from '../../../../../ui-components' interface BannerProps { action?: { - as?: ElementType | keyof JSX.IntrinsicElements + as?: ElementType | keyof React.JSX.IntrinsicElements icon?: ComponentType onClick?: () => void text: string diff --git a/packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx b/packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx index e48bd253e3f..eb2521a34c0 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/banners/DraftLiveEditBanner.tsx @@ -26,7 +26,7 @@ export function DraftLiveEditBanner({ displayed, documentId, schemaType, -}: DraftLiveEditBannerProps): JSX.Element | null { +}: DraftLiveEditBannerProps): React.JSX.Element | null { const {t} = useTranslation(structureLocaleNamespace) const [isPublishing, setPublishing] = useState(false) const [isDiscarding, setDiscarding] = useState(false) diff --git a/packages/sanity/src/structure/panes/document/documentPanel/header/DocumentHeaderTitle.tsx b/packages/sanity/src/structure/panes/document/documentPanel/header/DocumentHeaderTitle.tsx index ee6fe289438..9f09500af68 100644 --- a/packages/sanity/src/structure/panes/document/documentPanel/header/DocumentHeaderTitle.tsx +++ b/packages/sanity/src/structure/panes/document/documentPanel/header/DocumentHeaderTitle.tsx @@ -4,7 +4,7 @@ import {unstable_useValuePreview as useValuePreview, useTranslation} from 'sanit import {structureLocaleNamespace} from '../../../../i18n' import {useDocumentPane} from '../../useDocumentPane' -export function DocumentHeaderTitle(): ReactElement { +export function DocumentHeaderTitle(): ReactElement<any> { const {connectionState, schemaType, title, editState} = useDocumentPane() const documentValue = editState?.draft || editState?.published const subscribed = Boolean(documentValue) diff --git a/packages/sanity/src/structure/panes/document/inspectors/changes/ChangesInspector.tsx b/packages/sanity/src/structure/panes/document/inspectors/changes/ChangesInspector.tsx index 8eb38d8c7d6..db4d702d96a 100644 --- a/packages/sanity/src/structure/panes/document/inspectors/changes/ChangesInspector.tsx +++ b/packages/sanity/src/structure/panes/document/inspectors/changes/ChangesInspector.tsx @@ -35,7 +35,7 @@ const Grid = styled(Box)` gap: 0.25em; ` -export function ChangesInspector({showChanges}: {showChanges: boolean}): ReactElement { +export function ChangesInspector({showChanges}: {showChanges: boolean}): ReactElement<any> { const {documentId, schemaType, timelineError, timelineStore, value} = useDocumentPane() const [scrollRef, setScrollRef] = useState<HTMLDivElement | null>(null) diff --git a/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusBar.tsx b/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusBar.tsx index 58325306bce..5ad06730077 100644 --- a/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusBar.tsx +++ b/packages/sanity/src/structure/panes/document/statusBar/DocumentStatusBar.tsx @@ -45,7 +45,7 @@ export function DocumentStatusBar(props: DocumentStatusBarProps) { const shouldRender = editState?.ready && typeof collapsed === 'boolean' - let actions: JSX.Element | null = null + let actions: React.JSX.Element | null = null if (createLinkMetadata && isSanityCreateLinked(createLinkMetadata) && CreateLinkedActions) { actions = ( <CreateLinkedActions diff --git a/packages/sanity/src/structure/panes/document/statusBar/RevisionStatusLine.tsx b/packages/sanity/src/structure/panes/document/statusBar/RevisionStatusLine.tsx index 18a586bbd05..84682b965f6 100644 --- a/packages/sanity/src/structure/panes/document/statusBar/RevisionStatusLine.tsx +++ b/packages/sanity/src/structure/panes/document/statusBar/RevisionStatusLine.tsx @@ -16,7 +16,7 @@ export const StatusText = styled(Text)` } ` -export function RevisionStatusLine(): JSX.Element { +export function RevisionStatusLine(): React.JSX.Element { const {displayed} = useDocumentPane() const {t} = useTranslation() const date = displayed?._updatedAt || displayed?._createdAt diff --git a/packages/sanity/src/structure/panes/documentList/sheetList/SheetListCell.tsx b/packages/sanity/src/structure/panes/documentList/sheetList/SheetListCell.tsx index 6db364f71ad..7c9fd9f4b34 100644 --- a/packages/sanity/src/structure/panes/documentList/sheetList/SheetListCell.tsx +++ b/packages/sanity/src/structure/panes/documentList/sheetList/SheetListCell.tsx @@ -157,7 +157,9 @@ export function SheetListCellInner(props: SheetListCellInnerProps) { 'aria-selected': !!cellState, 'data-testid': cellId, 'id': cellId, - 'ref': (ref: InputRef) => (inputRef.current = ref), + 'ref': (ref: InputRef) => { + inputRef.current = ref + }, } if (fieldType.name === 'boolean') { diff --git a/packages/sanity/src/structure/panes/userComponent/UserComponentPane.tsx b/packages/sanity/src/structure/panes/userComponent/UserComponentPane.tsx index 62cb29aa4bc..0b05469eb06 100644 --- a/packages/sanity/src/structure/panes/userComponent/UserComponentPane.tsx +++ b/packages/sanity/src/structure/panes/userComponent/UserComponentPane.tsx @@ -47,7 +47,6 @@ export function UserComponentPane(props: UserComponentPaneProps) { // NOTE: here we're utilizing the function form of refs so setting // the ref causes a re-render for `UserComponentPaneHeader` ref={setRef as any} - // @ts-expect-error - @TODO Fix typings child={child} paneKey={paneKey} /> diff --git a/packages/sanity/src/ui-components/errorBoundary/ErrorBoundary.tsx b/packages/sanity/src/ui-components/errorBoundary/ErrorBoundary.tsx index 09c0583f66f..ad95f625c3e 100644 --- a/packages/sanity/src/ui-components/errorBoundary/ErrorBoundary.tsx +++ b/packages/sanity/src/ui-components/errorBoundary/ErrorBoundary.tsx @@ -13,7 +13,7 @@ export type ErrorBoundaryProps = UIErrorBoundaryProps * ErrorBoundary component that catches errors and uses onUncaughtError config property * It also calls the onCatch prop if it exists. */ -export function ErrorBoundary({onCatch, ...rest}: ErrorBoundaryProps): JSX.Element { +export function ErrorBoundary({onCatch, ...rest}: ErrorBoundaryProps): React.JSX.Element { // Use context, because source could be undefined and we don't want to throw in that case const source = useContext(SourceContext) diff --git a/packages/sanity/src/ui-components/menuGroup/MenuGroup.tsx b/packages/sanity/src/ui-components/menuGroup/MenuGroup.tsx index b1516f20b93..a9299afe823 100644 --- a/packages/sanity/src/ui-components/menuGroup/MenuGroup.tsx +++ b/packages/sanity/src/ui-components/menuGroup/MenuGroup.tsx @@ -11,7 +11,8 @@ export type MenuGroupProps = Pick<UIMenuGroupProps, 'icon' | 'popover' | 'text' * @internal */ export const MenuGroup = ( - props: MenuGroupProps & Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'tabIndex'>, + props: MenuGroupProps & + Omit<HTMLProps<HTMLDivElement>, 'as' | 'height' | 'ref' | 'tabIndex' | 'popover'>, ) => { return <UIMenuGroup {...props} fontSize={1} padding={3} /> } diff --git a/packages/sanity/src/ui-components/menuItem/MenuItem.tsx b/packages/sanity/src/ui-components/menuItem/MenuItem.tsx index 952ba655302..33e7e2cacfc 100644 --- a/packages/sanity/src/ui-components/menuItem/MenuItem.tsx +++ b/packages/sanity/src/ui-components/menuItem/MenuItem.tsx @@ -12,7 +12,6 @@ import { forwardRef, type HTMLProps, isValidElement, - type JSX, type ReactNode, type Ref, useCallback, @@ -53,7 +52,7 @@ export type MenuItemProps = Pick< /** * Optional render callback which receives menu item content. */ - renderMenuItem?: (menuItemContent: JSX.Element) => ReactNode + renderMenuItem?: (menuItemContent: React.JSX.Element) => ReactNode text?: string tooltipProps?: TooltipProps | null /** diff --git a/perf/efps/package.json b/perf/efps/package.json index 02b34f46c55..30621d4201b 100644 --- a/perf/efps/package.json +++ b/perf/efps/package.json @@ -18,8 +18,8 @@ "devDependencies": { "@sanity/client": "^6.24.1", "@swc-node/register": "^1.10.9", - "@types/react": "^18.3.12", - "@types/react-dom": "^18.3.1", + "@types/react": "^19.0.2", + "@types/react-dom": "^19.0.2", "@types/serve-handler": "^6.1.4", "@types/yargs": "^17.0.7", "@vitejs/plugin-react": "^4.3.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5a580af805e..fb4f0ddf1a5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -76,8 +76,8 @@ importers: specifier: ^22.10.0 version: 22.10.2 '@types/react': - specifier: ^18.3.12 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 '@types/semver': specifier: ^7.5.6 version: 7.5.8 @@ -271,11 +271,11 @@ importers: version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@types/react': - specifier: ^18.3.18 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 '@types/react-dom': - specifier: ^18.3.5 - version: 18.3.5(@types/react@18.3.18) + specifier: ^19.0.2 + version: 19.0.2(@types/react@19.0.2) '@vitejs/plugin-react': specifier: ^4.3.4 version: 4.3.4(vite@5.4.11(@types/node@22.10.2)(terser@5.37.0)) @@ -404,10 +404,10 @@ importers: version: 5.0.0(@emotion/is-prop-valid@1.3.1)(easymde@2.18.0)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) sanity-plugin-media: specifier: ^2.3.1 - version: 2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) sanity-plugin-mux-input: specifier: ^2.2.1 - version: 2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) sanity-test-studio: specifier: workspace:* version: link:../test-studio @@ -470,7 +470,7 @@ importers: dependencies: '@portabletext/editor': specifier: ^1.19.0 - version: 1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@portabletext/react': specifier: ^3.0.0 version: 3.2.0(react@18.3.1) @@ -602,10 +602,10 @@ importers: version: 5.0.0(@emotion/is-prop-valid@1.3.1)(easymde@2.18.0)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) sanity-plugin-media: specifier: ^2.3.1 - version: 2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) sanity-plugin-mux-input: specifier: ^2.2.1 - version: 2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) styled-components: specifier: ^6.1.11 version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -760,9 +760,6 @@ importers: '@sanity/types': specifier: 3.68.3 version: link:../types - '@types/react': - specifier: ^18.3.5 - version: 18.3.18 get-random-values-esm: specifier: 1.0.2 version: 1.0.2 @@ -785,6 +782,9 @@ importers: '@types/lodash': specifier: ^4.17.7 version: 4.17.13 + '@types/react': + specifier: ^19.0.2 + version: 19.0.2 '@vercel/stega': specifier: 0.1.2 version: 0.1.2 @@ -1227,8 +1227,8 @@ importers: specifier: ^1.13.0 version: 1.13.0 '@types/react': - specifier: ^18.3.12 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 rimraf: specifier: ^5.0.10 version: 5.0.10 @@ -1252,8 +1252,8 @@ importers: specifier: 1.0.18 version: 1.0.18(@emotion/is-prop-valid@1.3.1)(@sanity/types@packages+@sanity+types)(react-dom@19.0.0-rc-f994737d14-20240522(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@19.0.0-rc-f994737d14-20240522(react@18.3.1))(react@18.3.1)) '@types/react': - specifier: ^18.3.5 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 '@vitejs/plugin-react': specifier: ^4.3.4 version: 4.3.4(vite@6.0.6(@types/node@22.10.2)(terser@5.37.0)(yaml@2.6.1)) @@ -1447,7 +1447,7 @@ importers: version: 3.4.0 '@portabletext/editor': specifier: ^1.19.0 - version: 1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) + version: 1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) '@portabletext/react': specifier: ^3.0.0 version: 3.2.0(react@18.3.1) @@ -1536,8 +1536,8 @@ importers: specifier: ^3.11.2 version: 3.11.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@types/react-is': - specifier: ^18.3.0 - version: 18.3.1 + specifier: ^19.0.0 + version: 19.0.0 '@types/shallow-equals': specifier: ^1.0.0 version: 1.0.3 @@ -1705,7 +1705,7 @@ importers: version: 3.2.2 react-focus-lock: specifier: ^2.13.5 - version: 2.13.5(@types/react@18.3.18)(react@18.3.1) + version: 2.13.5(@types/react@19.0.2)(react@18.3.1) react-i18next: specifier: 14.0.2 version: 14.0.2(i18next@23.16.8)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -1817,7 +1817,7 @@ importers: version: 6.6.3 '@testing-library/react': specifier: ^16.1.0 - version: 16.1.0(@testing-library/dom@10.4.0)(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 16.1.0(@testing-library/dom@10.4.0)(@types/react-dom@19.0.2(@types/react@19.0.2))(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@testing-library/user-event': specifier: ^13.5.0 version: 13.5.0(@testing-library/dom@10.4.0) @@ -1846,11 +1846,11 @@ importers: specifier: ^3.4.0 version: 3.4.3 '@types/react': - specifier: ^18.3.12 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 '@types/react-dom': - specifier: ^18.3.1 - version: 18.3.5(@types/react@18.3.18) + specifier: ^19.0.2 + version: 19.0.2(@types/react@19.0.2) '@types/refractor': specifier: ^3.0.0 version: 3.4.1 @@ -1939,11 +1939,11 @@ importers: specifier: ^1.10.9 version: 1.10.9(@swc/core@1.10.1(@swc/helpers@0.5.15))(@swc/types@0.1.17)(typescript@5.7.2) '@types/react': - specifier: ^18.3.12 - version: 18.3.18 + specifier: ^19.0.2 + version: 19.0.2 '@types/react-dom': - specifier: ^18.3.1 - version: 18.3.5(@types/react@18.3.18) + specifier: ^19.0.2 + version: 19.0.2(@types/react@19.0.2) '@types/serve-handler': specifier: ^6.1.4 version: 6.1.4 @@ -5372,19 +5372,16 @@ packages: '@types/progress-stream@2.0.5': resolution: {integrity: sha512-5YNriuEZkHlFHHepLIaxzq3atGeav1qCTGzB74HKWpo66qjfostF+rHc785YYYHeBytve8ZG3ejg42jEIfXNiQ==} - '@types/prop-types@15.7.14': - resolution: {integrity: sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==} - '@types/raf@3.4.3': resolution: {integrity: sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==} - '@types/react-dom@18.3.5': - resolution: {integrity: sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==} + '@types/react-dom@19.0.2': + resolution: {integrity: sha512-c1s+7TKFaDRRxr1TxccIX2u7sfCnc3RxkVyBIUA2lCpyqCF+QoAwQ/CBg7bsMdVwP120HEH143VQezKtef5nCg==} peerDependencies: - '@types/react': ^18.0.0 + '@types/react': ^19.0.0 - '@types/react-is@18.3.1': - resolution: {integrity: sha512-zts4lhQn5ia0cF/y2+3V6Riu0MAfez9/LJYavdM8TvcVl+S91A/7VWxyBT8hbRuWspmuCaiGI0F41OJYGrKhRA==} + '@types/react-is@19.0.0': + resolution: {integrity: sha512-71dSZeeJ0t3aoPyY9x6i+JNSvg5m9EF2i2OlSZI5QoJuI8Ocgor610i+4A10TQmURR+0vLwcVCEYFpXdzM1Biw==} '@types/react-redux@7.1.34': resolution: {integrity: sha512-GdFaVjEbYv4Fthm2ZLvj1VSCedV7TqE5y1kNwnjSdBOTXuRSgowux6J8TAct15T3CKBr63UMk+2CO7ilRhyrAQ==} @@ -5394,8 +5391,8 @@ packages: peerDependencies: '@types/react': '*' - '@types/react@18.3.18': - resolution: {integrity: sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==} + '@types/react@19.0.2': + resolution: {integrity: sha512-USU8ZI/xyKJwFTpjSVIrSeHBVAGagkHQKPNbxeWwql/vDmnTIBgx+TJnhFnj1NXgz8XfprU0egV2dROLGpsBEg==} '@types/readdir-glob@1.1.5': resolution: {integrity: sha512-raiuEPUYqXu+nvtY2Pe8s8FEmZ3x5yAH4VkLdihcPdalvsHltomrRC9BzuStrJ9yk06470hS0Crw0f1pXqD+Hg==} @@ -13449,7 +13446,7 @@ snapshots: '@emotion/memoize@0.9.0': {} - '@emotion/react@11.14.0(@types/react@18.3.18)(react@18.3.1)': + '@emotion/react@11.14.0(@types/react@19.0.2)(react@18.3.1)': dependencies: '@babel/runtime': 7.26.0 '@emotion/babel-plugin': 11.13.5 @@ -13461,7 +13458,7 @@ snapshots: hoist-non-react-statics: 3.3.2 react: 18.3.1 optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 transitivePeerDependencies: - supports-color @@ -14308,7 +14305,7 @@ snapshots: - supports-color - utf-8-validate - '@mux/mux-player-react@2.9.1(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@mux/mux-player-react@2.9.1(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@mux/mux-player': 2.9.1 '@mux/playback-core': 0.25.2 @@ -14316,7 +14313,7 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 '@mux/mux-player@2.9.1': dependencies: @@ -14906,13 +14903,13 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@portabletext/editor@1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': + '@portabletext/editor@1.19.0(@sanity/block-tools@packages+@sanity+block-tools)(@sanity/schema@packages+@sanity+schema)(@sanity/types@packages+@sanity+types)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(rxjs@7.8.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: '@portabletext/patches': 1.1.1 '@sanity/block-tools': link:packages/@sanity/block-tools '@sanity/schema': link:packages/@sanity/schema '@sanity/types': link:packages/@sanity/types - '@xstate/react': 5.0.1(@types/react@18.3.18)(react@18.3.1)(xstate@5.19.1) + '@xstate/react': 5.0.1(@types/react@19.0.2)(react@18.3.1)(xstate@5.19.1) debug: 4.4.0(supports-color@9.4.0) get-random-values-esm: 1.0.2 lodash: 4.17.21 @@ -16176,15 +16173,15 @@ snapshots: lodash: 4.17.21 redent: 3.0.0 - '@testing-library/react@16.1.0(@testing-library/dom@10.4.0)(@types/react-dom@18.3.5(@types/react@18.3.18))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@testing-library/react@16.1.0(@testing-library/dom@10.4.0)(@types/react-dom@19.0.2(@types/react@19.0.2))(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.26.0 '@testing-library/dom': 10.4.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: - '@types/react': 18.3.18 - '@types/react-dom': 18.3.5(@types/react@18.3.18) + '@types/react': 19.0.2 + '@types/react-dom': 19.0.2(@types/react@19.0.2) '@testing-library/user-event@13.5.0(@testing-library/dom@10.4.0)': dependencies: @@ -16321,7 +16318,7 @@ snapshots: '@types/hoist-non-react-statics@3.3.6': dependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 hoist-non-react-statics: 3.3.2 '@types/inquirer@6.5.0': @@ -16377,32 +16374,29 @@ snapshots: dependencies: '@types/node': 22.10.2 - '@types/prop-types@15.7.14': {} - '@types/raf@3.4.3': {} - '@types/react-dom@18.3.5(@types/react@18.3.18)': + '@types/react-dom@19.0.2(@types/react@19.0.2)': dependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 - '@types/react-is@18.3.1': + '@types/react-is@19.0.0': dependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 '@types/react-redux@7.1.34': dependencies: '@types/hoist-non-react-statics': 3.3.6 - '@types/react': 18.3.18 + '@types/react': 19.0.2 hoist-non-react-statics: 3.3.2 redux: 4.2.1 - '@types/react-transition-group@4.4.12(@types/react@18.3.18)': + '@types/react-transition-group@4.4.12(@types/react@19.0.2)': dependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 - '@types/react@18.3.18': + '@types/react@19.0.2': dependencies: - '@types/prop-types': 15.7.14 csstype: 3.1.3 '@types/readdir-glob@1.1.5': @@ -16809,10 +16803,10 @@ snapshots: '@xstate/fsm@1.6.5': {} - '@xstate/react@5.0.1(@types/react@18.3.18)(react@18.3.1)(xstate@5.19.1)': + '@xstate/react@5.0.1(@types/react@19.0.2)(react@18.3.1)(xstate@5.19.1)': dependencies: react: 18.3.1 - use-isomorphic-layout-effect: 1.2.0(@types/react@18.3.18)(react@18.3.1) + use-isomorphic-layout-effect: 1.2.0(@types/react@19.0.2)(react@18.3.1) use-sync-external-store: 1.4.0(react@18.3.1) optionalDependencies: xstate: 5.19.1 @@ -22215,17 +22209,17 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-focus-lock@2.13.5(@types/react@18.3.18)(react@18.3.1): + react-focus-lock@2.13.5(@types/react@19.0.2)(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 focus-lock: 1.3.5 prop-types: 15.8.1 react: 18.3.1 react-clientside-effect: 1.2.7(react@18.3.1) - use-callback-ref: 1.3.3(@types/react@18.3.18)(react@18.3.1) - use-sidecar: 1.1.3(@types/react@18.3.18)(react@18.3.1) + use-callback-ref: 1.3.3(@types/react@19.0.2)(react@18.3.1) + use-sidecar: 1.1.3(@types/react@19.0.2)(react@18.3.1) optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 react-hook-form@7.54.1(react@18.3.1): dependencies: @@ -22296,19 +22290,19 @@ snapshots: mri: 1.2.0 playwright: 1.49.1 - react-select@5.9.0(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-select@5.9.0(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 '@emotion/cache': 11.14.0 - '@emotion/react': 11.14.0(@types/react@18.3.18)(react@18.3.1) + '@emotion/react': 11.14.0(@types/react@19.0.2)(react@18.3.1) '@floating-ui/dom': 1.6.12 - '@types/react-transition-group': 4.4.12(@types/react@18.3.18) + '@types/react-transition-group': 4.4.12(@types/react@19.0.2) memoize-one: 6.0.0 prop-types: 15.8.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-transition-group: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - use-isomorphic-layout-effect: 1.2.0(@types/react@18.3.18)(react@18.3.1) + use-isomorphic-layout-effect: 1.2.0(@types/react@19.0.2)(react@18.3.1) transitivePeerDependencies: - '@types/react' - supports-color @@ -22812,7 +22806,7 @@ snapshots: - react-dom - react-is - sanity-plugin-media@2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): + sanity-plugin-media@2.3.2(@sanity/ui@2.10.17(@emotion/is-prop-valid@1.3.1)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)))(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): dependencies: '@hookform/resolvers': 3.9.1(react-hook-form@7.54.1(react@18.3.1)) '@reduxjs/toolkit': 1.9.7(react-redux@7.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) @@ -22834,7 +22828,7 @@ snapshots: react-file-icon: 1.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-hook-form: 7.54.1(react@18.3.1) react-redux: 7.2.9(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react-select: 5.9.0(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-select: 5.9.0(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-virtuoso: 4.12.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) redux: 4.2.1 redux-observable: 2.0.0(redux@4.2.1) @@ -22847,9 +22841,9 @@ snapshots: - react-native - supports-color - sanity-plugin-mux-input@2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): + sanity-plugin-mux-input@2.4.0(@emotion/is-prop-valid@1.3.1)(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react-is@19.0.0-rc.1)(react@18.3.1)(sanity@packages+sanity)(styled-components@6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1)): dependencies: - '@mux/mux-player-react': 2.9.1(@types/react@18.3.18)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@mux/mux-player-react': 2.9.1(@types/react@19.0.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mux/upchunk': 3.4.0 '@sanity/icons': 3.5.7(react@18.3.1) '@sanity/incompatible-plugin': 1.0.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -24101,12 +24095,12 @@ snapshots: querystringify: 2.2.0 requires-port: 1.0.0 - use-callback-ref@1.3.3(@types/react@18.3.18)(react@18.3.1): + use-callback-ref@1.3.3(@types/react@19.0.2)(react@18.3.1): dependencies: react: 18.3.1 tslib: 2.8.1 optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 use-device-pixel-ratio@1.1.2(react@18.3.1): dependencies: @@ -24130,19 +24124,19 @@ snapshots: dependencies: react: 18.3.1 - use-isomorphic-layout-effect@1.2.0(@types/react@18.3.18)(react@18.3.1): + use-isomorphic-layout-effect@1.2.0(@types/react@19.0.2)(react@18.3.1): dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 - use-sidecar@1.1.3(@types/react@18.3.18)(react@18.3.1): + use-sidecar@1.1.3(@types/react@19.0.2)(react@18.3.1): dependencies: detect-node-es: 1.1.0 react: 18.3.1 tslib: 2.8.1 optionalDependencies: - '@types/react': 18.3.18 + '@types/react': 19.0.2 use-sync-external-store@1.4.0(react@18.3.1): dependencies: diff --git a/turbo.json b/turbo.json index b6776b982d9..f50a91ea334 100644 --- a/turbo.json +++ b/turbo.json @@ -3,6 +3,7 @@ // All environment variables that should invalidate a cached build needs to be declared here "globalEnv": [ "CI", + "GITHUB_ACTIONS", "DEBUG", "NODE_ENV", "PKG_FORMAT",