Expandir minha barra de realizações na Comunidade.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.

SOLUCIONADO

Can we allow multiple component inside a SPA component build in React ?

Avatar

Level 1

Hello everyone!

 

In my local, I'm utilizing a SPA react component. I received a request for a bring option to allow multiple components inside SPA react components like Tab and Accordion.

 

  1. Is it possible to use the Tab and Accordion components feature within the SPA component?
  2. Is it the SPA React component or an AEM standard component that I will be permitted to use inside it?

 

Thank you.

1 Solução aceita

Avatar

Resposta correta de
Community Advisor

You can include a component inside another component within SPA, but, that must be done through code.

As AEM already provides a parsys functionality for the same, we can achieve this relatively easily through AEM component.

 

Inside your AEM component's HTML(which would be importing the SPA component), just add a parsys and in the template policy only allow Tab & Accordion for it.

Also, if you need it to be dependent on a option which is controlled by authoring, just add a sly-test on the parsys rendering.

Ver solução na publicação original

2 Respostas

Avatar

Employee Advisor

Hi @Kaibalya_123 ,

 

The answer is totally subjective to requirement.

 

Best way to manage this is to create atomic and composite components.

 

For instance,
Atomic components can be - image, form fields

Composite components - Image card (image + heading) by using atomic components.

 

Also refer this repo : https://github.com/adobe/aem-react-core-wcm-components-spa/blob/master/README.md

 

Hope this helps, thanks.

Avatar

Resposta correta de
Community Advisor

You can include a component inside another component within SPA, but, that must be done through code.

As AEM already provides a parsys functionality for the same, we can achieve this relatively easily through AEM component.

 

Inside your AEM component's HTML(which would be importing the SPA component), just add a parsys and in the template policy only allow Tab & Accordion for it.

Also, if you need it to be dependent on a option which is controlled by authoring, just add a sly-test on the parsys rendering.