Skip to content

Commit 06b7789

Browse files
committed
Fix types
1 parent af9229b commit 06b7789

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/hooks/useContent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client';
22

3-
import {SlotContent, VersionedSlotId, VersionedSlotMap} from '@croct/plug/slot';
3+
import {DynamicSlotId, SlotContent, VersionedSlotId, VersionedSlotMap} from '@croct/plug/slot';
44
import {JsonObject} from '@croct/plug/sdk/json';
55
import {FetchOptions} from '@croct/plug/plug';
66
import {useEffect, useMemo, useState} from 'react';
@@ -40,10 +40,10 @@ function useCsrContent<I, F, O extends FetchResponseOptions>(
4040
() => getSlotContent(id, normalizedLocale) as SlotContent|null ?? undefined,
4141
[id, normalizedLocale],
4242
);
43-
const fallback = fallbackContent === undefined ? defaultContent : fallbackContent;
43+
const fallback = (fallbackContent === undefined ? defaultContent : fallbackContent) as SlotContent;
4444
const [initial, setInitial] = useState(
4545
() => {
46-
const content = initialContent === undefined ? defaultContent : initialContent;
46+
const content = (initialContent === undefined ? defaultContent : initialContent);
4747

4848
if (content === undefined) {
4949
return undefined;
@@ -62,7 +62,7 @@ function useCsrContent<I, F, O extends FetchResponseOptions>(
6262
+ `:${normalizedLocale ?? ''}`
6363
+ `:${JSON.stringify(fetchOptions?.attributes ?? {})}`,
6464
),
65-
loader: () => croct.fetch<VersionedSlotId, FetchResponseOptions>(id, {
65+
loader: () => croct.fetch<DynamicSlotId, FetchResponseOptions>(id, {
6666
...fetchOptions,
6767
...(normalizedLocale !== undefined ? {preferredLocale: normalizedLocale} : {}),
6868
...(fallback !== undefined ? {fallback: fallback} : {}),

0 commit comments

Comments
 (0)