Is there a way to create a project structure for both SPA and Non SPA components? | Community
Skip to main content
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 SantoshSai

HI @sukghosa-2 ,

IMO, it's not possible to mix a Non SPA and SPA component in SPA page, If you want to create any component using SPA template then it's not possible.

  • You can try adding some text or something at the page template level (Which will be hardcoded not a draggable component), But this will be effective across the template.
  • You can have your own template created and and create HTL component in the same project structure.

NOTE: You can not use non SPA component in SPA template. As in SPA everything is client-side rendered.
If you see the body.html we only have root div to render at react side.

You can check out this article [0] on the same, for more details.

[0]: https://aemsimplifiedbynikhil.wordpress.com/2020/08/18/aem-spa-react-project-setup-and-component-integration-walk-through-aem-6-5-5/

Hope that helps you!

Regards,

Santosh

1 reply

SantoshSai
Community Advisor
SantoshSaiCommunity AdvisorAccepted solution
Community Advisor
November 10, 2022

HI @sukghosa-2 ,

IMO, it's not possible to mix a Non SPA and SPA component in SPA page, If you want to create any component using SPA template then it's not possible.

  • You can try adding some text or something at the page template level (Which will be hardcoded not a draggable component), But this will be effective across the template.
  • You can have your own template created and and create HTL component in the same project structure.

NOTE: You can not use non SPA component in SPA template. As in SPA everything is client-side rendered.
If you see the body.html we only have root div to render at react side.

You can check out this article [0] on the same, for more details.

[0]: https://aemsimplifiedbynikhil.wordpress.com/2020/08/18/aem-spa-react-project-setup-and-component-integration-walk-through-aem-6-5-5/

Hope that helps you!

Regards,

Santosh

Santosh Sai