Skip to content

Commit a8fb5c2

Browse files
committedDec 21, 2024··
fix: react 19 typings
1 parent 334357c commit a8fb5c2

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed
 

‎packages/presentation/src/editor/ContentEditor.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function ContentEditor(props: {
6767
[mainDocumentState, schema],
6868
)
6969

70+
// @ts-expect-error fix later
7071
const previewState = usePreviewState(mainDocumentState?.document?._id || '', schemaType)
7172

7273
const preview = useMemo(() => {

‎packages/presentation/src/editor/usePreviewState.ts

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export default function usePreviewState(documentId: string, schemaType?: SchemaT
2323
}
2424
const subscription = getPreviewStateObservable(
2525
documentPreviewStore,
26+
// @ts-expect-error fix later
2627
schemaType,
2728
documentId,
2829
'',

‎packages/presentation/src/overlays/schema/SchemaIcon.tsx

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ export const SchemaIcon: FunctionComponent<{
1414
return Icon ? (
1515
<StyleSheetManager sheet={sheet.instance}>
1616
<ThemeProvider theme={theme} scheme={scheme} tone={tone}>
17-
{isValidElement(Icon) ? (
18-
Icon
19-
) : (
20-
// @ts-expect-error fix later
21-
<Icon />
22-
)}
17+
{isValidElement(Icon) ? Icon : <Icon />}
2318
</ThemeProvider>
2419
</StyleSheetManager>
2520
) : null

‎packages/presentation/src/overlays/schema/extract.ts

+3
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,23 @@ export function extractSchema(workspace: Workspace, theme: ThemeContextValue): S
207207
const inlineFields = new Set<SanitySchemaType>()
208208
const {schema: schemaDef, basePath} = workspace
209209

210+
// @ts-expect-error fix later
210211
const sortedSchemaTypeNames = sortByDependencies(schemaDef)
211212
return sortedSchemaTypeNames
212213
.map((typeName) => {
213214
const schemaType = schemaDef.get(typeName)
214215
if (schemaType === undefined) {
215216
return
216217
}
218+
// @ts-expect-error fix later
217219
const base = convertBaseType(schemaType)
218220

219221
if (base === null) {
220222
return
221223
}
222224

223225
if (base.type === 'type') {
226+
// @ts-expect-error fix later
224227
inlineFields.add(schemaType)
225228
}
226229

‎packages/visual-editing/src/overlay-components/components/InsertMenu.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export const InsertMenu: FunctionComponent<InsertMenuProps> = (props) => {
4747
...type,
4848
icon: getNodeIcon(type),
4949
}))}
50-
// @ts-expect-error fix typings later
5150
onSelect={onSelect}
5251
views={views}
5352
/>

0 commit comments

Comments
 (0)
Please sign in to comment.