Menu

How to map AEM component with SPA React/Angular component

MapTo function is provided by the AEM SPA Editor JS SDK (@adobe/aem-react-editable-components). The AEM component path /apps/jorvee/components/text represents the sling:resourceType of the AEM component. This path gets matched with the :type exposed by the JSON model observed earlier. MapTo takes care of parsing the JSON model response and passing the correct values as props to the SPA component.

MapTo('jorvee/components/text')(Text, TextEditConfig);

Above MapTo function will map your AEM Text component with SPA Text component. The complete line will be like this with export keyword.

export default MapTo('wknd-spa-react/components/text')(Text, TextEditConfig);


Reference

https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/spa-editor/react/map-components.html?lang=en 

AEM with React component MapTo function
Map AEM with React component


1 comment: