AEM SPA (React) not compatible with Latest AEM Core Component | Community
Skip to main content
Mahedi_Sabuj
Community Advisor
Community Advisor
July 14, 2023
Solved

AEM SPA (React) not compatible with Latest AEM Core Component

  • July 14, 2023
  • 1 reply
  • 1471 views

I am using AEM ArcheType 41 and AEM Core Components v2.21.0
I inherited Image Core Component and found that React Component HTML not match with Core Component HTML. To resolve the issue, I tried to overwrite React Component but got typing error in Typescript - "Unresolved Variable srcset".
Although srcset is available on Sling Model, it is missing at React Typescript interface. For now, I added new interface which extends Core Component ImageV2Model.
What would be the best practices here? Also, Can anyone know that any plan to update @adobe/aem-core-components-react-base package?

 

interface ImageModel extends ImageV2Model { srcset: string } const Image = (props: ImageModel) => { const { isInEditor = false } = props; return ( <div className={`${props.baseCssClass}${isInEditor ? ' cq-dd-image' : ''}`} itemScope itemType='https://schema.org/ImageObject'> <image src={props.src} className={props.baseCssClass + '__image'} srcset={props.srcset} itemprop='contentUrl' alt={props.alt}/> </div> ); }

 

Here are React Packages:

 

"@adobe/aem-core-components-react-base": "^1.1.8", "@adobe/aem-core-components-react-spa": "^1.2.0", "@adobe/aem-react-editable-components": "^1.1.6", "@adobe/aem-spa-component-mapping": "^1.1.1", "@adobe/aem-spa-page-model-manager": "^1.3.11"

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Nishant-Singh

@mahedi_sabuj 

 

It will be good if you raise an issue by using github (link below)

https://github.com/adobe/aem-react-core-wcm-components-base/issues

Provide all details version information and steps to replicate. Team will take those things in future releases.

1 reply

Nishant-Singh
Adobe Employee
Nishant-SinghAdobe EmployeeAccepted solution
Adobe Employee
July 17, 2023

@mahedi_sabuj 

 

It will be good if you raise an issue by using github (link below)

https://github.com/adobe/aem-react-core-wcm-components-base/issues

Provide all details version information and steps to replicate. Team will take those things in future releases.

Mahedi_Sabuj
Community Advisor
Community Advisor
July 17, 2023

Thanks @nishant-singh, Although there hasn't been much activity on the repository, I will raise an issue on GitHub.

Mahedi Sabuj