How to include parsys in my aem react spa component | Community
Skip to main content
Level 2
June 13, 2024
Solved

How to include parsys in my aem react spa component

  • June 13, 2024
  • 3 replies
  • 1402 views

I'm currently creating a component using React SPA, and I would like to know how can I insert a parsys, or something that allows me to drag a component into my component. I can't find documentation on how to do it, or how I can use Sightly inside my react component.

 

Thanks

 

 

 

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 abhishekanand_

Hi @bangar20 ,

Unfortunately, React SPAs in AEM don't directly support inserting Parsys or using Sightly within your React component. React handles client-side rendering, while Sightly is server-side.


If you need React and Sightly components on the same page, then probably you can try below approache

 

  • Separate Containers

Create two separate containers on your page, One container for React components (e.g., <div id="spa-root"></div>). AEM provides a "Layout Container" component specifically designed for React SPA development. This component allows you to define a layout structure within your React component and specify areas where child components can be dropped.


Another container for HTL components (e.g., <div id="responsive-root"></div>).
Inject HTL components into the second container once the React page is loaded.

 

3 replies

abhishekanand_
Community Advisor
abhishekanand_Community AdvisorAccepted solution
Community Advisor
June 13, 2024

Hi @bangar20 ,

Unfortunately, React SPAs in AEM don't directly support inserting Parsys or using Sightly within your React component. React handles client-side rendering, while Sightly is server-side.


If you need React and Sightly components on the same page, then probably you can try below approache

 

  • Separate Containers

Create two separate containers on your page, One container for React components (e.g., <div id="spa-root"></div>). AEM provides a "Layout Container" component specifically designed for React SPA development. This component allows you to define a layout structure within your React component and specify areas where child components can be dropped.


Another container for HTL components (e.g., <div id="responsive-root"></div>).
Inject HTL components into the second container once the React page is loaded.

 

Abhishek Anand
Mahedi_Sabuj
Community Advisor
Community Advisor
June 13, 2024

Hi @bangar20, You can check the link below. Hopefully it will be helpful.

https://ms-29.com/aem/spa/replicate-data-sly-resource-aem-spa 

Mahedi Sabuj