File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
packages/optimizely-cms-sdk/src Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,11 @@ export type InferFromProperty<T extends AnyProperty> =
105105export type InferredBase = {
106106 _id : string ;
107107 _metadata : InferredContentMetadata ;
108+
109+ // Properties that don't come from Graph are prefixed with double-underscores
108110 __typename : string ;
109111 __context ?: { edit : boolean ; preview_token : string } ;
110- composition ?: ExperienceComponentNode ;
112+ __composition ?: ExperienceComponentNode ;
111113} ;
112114
113115/** Only include keys where indexingType is not 'disabled' */
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ type OptimizelyComponentProps = {
8484 /** Preview context */
8585 __context ?: { edit : boolean ; preview_token : string } ;
8686
87- composition ?: ExperienceCompositionNode ;
87+ __composition ?: ExperienceCompositionNode ;
8888 } ;
8989
9090 displaySettings ?: Record < string , string > ;
@@ -98,7 +98,8 @@ export async function OptimizelyComponent({
9898 if ( ! componentRegistry ) {
9999 throw new Error ( 'You should call `initReactComponentRegistry` first' ) ;
100100 }
101- const dtKey = opti . composition ?. displayTemplateKey ?? opti . displayTemplateKey ;
101+ const dtKey =
102+ opti . __composition ?. displayTemplateKey ?? opti . displayTemplateKey ;
102103 const Component = await componentRegistry . getComponent ( opti . __typename , {
103104 tag : opti . __tag ?? getDisplayTemplateTag ( dtKey ) ,
104105 } ) ;
@@ -261,7 +262,7 @@ export function OptimizelyGridSection({
261262 < OptimizelyComponent
262263 opti = { {
263264 ...node . component ,
264- composition : node ,
265+ __composition : node ,
265266 __tag : tag ,
266267 } }
267268 key = { node . key }
You can’t perform that action at this time.
0 commit comments