Using General (HTL) Components in an AEM SPA (React) | Community
Skip to main content
Level 2
August 24, 2020
Solved

Using General (HTL) Components in an AEM SPA (React)

  • August 24, 2020
  • 1 reply
  • 2321 views

Hello everyone!

I would like to ask if it is possible to use an HTL component with an AEM SPA project. Let's say I wanted to use the Title HTL component, is there a way to do this? Thank you!

 

 

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 Nikhil-Kumar

@marcjermaine -
If you want to create any component using SPA template then it's not possible.
But 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 my article on the same, soon I will be coming up with one article in which I will list down the issues that I faced during my AEM+SPA project experience.

Thanks,
Nikhil

1 reply

Nikhil-Kumar
Community Advisor
Nikhil-KumarCommunity AdvisorAccepted solution
Community Advisor
August 24, 2020

@marcjermaine -
If you want to create any component using SPA template then it's not possible.
But 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 my article on the same, soon I will be coming up with one article in which I will list down the issues that I faced during my AEM+SPA project experience.

Thanks,
Nikhil

Level 2
August 24, 2020
Thank you so much for your response! I'm interested to know more about your AEM+SPA project experience as we are currently in the process of mapping the AEM Core Components to React. I'm facing issues at some of the core components since mapping them is not always obvious.