@dotcms/react
Advanced tools
@@ -8,10 +8,13 @@ /** | ||
| * | ||
| * Each component is awaited, so the returned record contains resolved `ReactNode` | ||
| * values — safe to pass as props to client components without `React.use()`. | ||
| * | ||
| * @public | ||
| * @param containers - The containers map from `pageAsset.containers` | ||
| * @param serverComponents - A map of content type names to async server components | ||
| * @returns A record mapping contentlet identifiers to pre-rendered ReactNodes | ||
| * @returns A promise resolving to a record mapping contentlet identifiers to pre-rendered ReactNodes | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * const slots = buildSlots(pageContent.pageAsset.containers, { | ||
| * const slots = await buildSlots(pageContent.pageAsset.containers, { | ||
| * BlogList: BlogListContainer, | ||
@@ -23,3 +26,3 @@ * }); | ||
| */ | ||
| function buildSlots(containers, serverComponents) { | ||
| async function buildSlots(containers, serverComponents) { | ||
| const slots = {}; | ||
@@ -33,3 +36,3 @@ for (const { | ||
| if (Component && contentlet.identifier) { | ||
| slots[contentlet.identifier] = Component(contentlet); | ||
| slots[contentlet.identifier] = await Component(contentlet); | ||
| } | ||
@@ -36,0 +39,0 @@ } |
+1
-1
| { | ||
| "name": "@dotcms/react", | ||
| "version": "1.2.6-next.3", | ||
| "version": "1.3.0", | ||
| "peerDependencies": { | ||
@@ -5,0 +5,0 @@ "react": ">=18", |
@@ -25,3 +25,3 @@ import { ReactNode } from 'react'; | ||
| */ | ||
| slots?: Record<string, ReactNode | Promise<ReactNode>>; | ||
| slots?: Record<string, ReactNode>; | ||
| } | ||
@@ -28,0 +28,0 @@ /** |
@@ -7,3 +7,3 @@ import { ReactNode } from 'react'; | ||
| mode: DotCMSPageRendererMode; | ||
| slots: Record<string, ReactNode | Promise<ReactNode>>; | ||
| slots?: Record<string, ReactNode>; | ||
| children: ReactNode; | ||
@@ -10,0 +10,0 @@ } |
@@ -11,3 +11,3 @@ import { ReactNode } from 'react'; | ||
| * @property {Record<string, React.ComponentType<DotCMSContentlet>>} userComponents - The user components | ||
| * @property {Record<string, ReactNode | Promise<ReactNode>>} [slots] - Pre-rendered server component nodes keyed by contentlet identifier | ||
| * @property {Record<string, ReactNode>} [slots] - Pre-rendered server component nodes keyed by contentlet identifier | ||
| */ | ||
@@ -18,3 +18,3 @@ export interface DotCMSPageContextProps { | ||
| userComponents: Record<string, React.ComponentType<DotCMSBasicContentlet>>; | ||
| slots?: Record<string, ReactNode | Promise<ReactNode>>; | ||
| slots?: Record<string, ReactNode>; | ||
| } | ||
@@ -21,0 +21,0 @@ /** |
@@ -10,10 +10,13 @@ import { ReactNode } from 'react'; | ||
| * | ||
| * Each component is awaited, so the returned record contains resolved `ReactNode` | ||
| * values — safe to pass as props to client components without `React.use()`. | ||
| * | ||
| * @public | ||
| * @param containers - The containers map from `pageAsset.containers` | ||
| * @param serverComponents - A map of content type names to async server components | ||
| * @returns A record mapping contentlet identifiers to pre-rendered ReactNodes | ||
| * @returns A promise resolving to a record mapping contentlet identifiers to pre-rendered ReactNodes | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * const slots = buildSlots(pageContent.pageAsset.containers, { | ||
| * const slots = await buildSlots(pageContent.pageAsset.containers, { | ||
| * BlogList: BlogListContainer, | ||
@@ -25,2 +28,2 @@ * }); | ||
| */ | ||
| export declare function buildSlots(containers: DotCMSPageAssetContainers, serverComponents: Record<string, (props: DotCMSBasicContentlet) => ReactNode | Promise<ReactNode>>): Record<string, ReactNode | Promise<ReactNode>>; | ||
| export declare function buildSlots(containers: DotCMSPageAssetContainers, serverComponents: Record<string, (props: DotCMSBasicContentlet) => ReactNode | Promise<ReactNode>>): Promise<Record<string, ReactNode>>; |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
130102
0.23%2776
0.22%1
-50%