Skip to main content
Mahedi_Sabuj
Community Advisor
Community Advisor
Jul 31, 2023 6:22 PM UTC
Solved

AEM React SPA - Extra Divs on Page Source

Hi Community Members, I have created AEM SPA (React) project using AEM ArcheType v41. Installed the package on local AEM v6.5.16 environment without making any changes. In "View as Publish" mode, I found some extra divs (Red Marked) on Inspect Element. Anyway to remove those extra divs?

Same issue for AEMaaCS as well. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-spa-editor-react-empty-divs/td-p/572051

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
mahi1729
mahi1729Accepted solution
Level 4
Aug 2, 2023 6:25 AM UTC

My understanding is this. Every component comes with its own empty-text placeholder and is appended below the actual component markup. When not in author an empty div tag is generated. Since it is a code level issue, I dont think there is an easy way around this. Perhaps the issue is remediated in v2.x but the design of v2.x is completely different from 1x. If its a new project migrate to v2.x to see if the issue persists.

 

See https://github.com/adobe/aem-react-editable-components/tree/v2.0.5/src/components for distinguishing differences/migration steps. Hope this gives us some insight.

8 replies

Adobe Employee
Aug 1, 2023 6:07 AM UTC
Mahedi_Sabuj
Community Advisor
Community Advisor
Aug 1, 2023 6:20 AM UTC

Hi @tushar_gupta, I checked the discussion before asking the question here. There are no concrete solution available in the link you shared.

Translate
Mahedi Sabuj
mahi1729
mahi1729Accepted solution
Level 4
Aug 2, 2023 6:25 AM UTC

My understanding is this. Every component comes with its own empty-text placeholder and is appended below the actual component markup. When not in author an empty div tag is generated. Since it is a code level issue, I dont think there is an easy way around this. Perhaps the issue is remediated in v2.x but the design of v2.x is completely different from 1x. If its a new project migrate to v2.x to see if the issue persists.

 

See https://github.com/adobe/aem-react-editable-components/tree/v2.0.5/src/components for distinguishing differences/migration steps. Hope this gives us some insight.

Translate
Mahedi_Sabuj
Community Advisor
Community Advisor
Aug 2, 2023 8:27 AM UTC

Hi @mahi1729, Let me update aem react editore component package to v2.0.5 (https://experienceleague.adobe.com/docs/experience-manager-learn/getting-started-with-aem-headless/spa-editor/how-to/react-core-components-v2.html). and verify the empty div issue.

Translate
Mahedi Sabuj
Adobe Employee
Nov 15, 2023 2:09 PM UTC

Hello, @mahedi_sabuj 

How was the result? Did you resolve your issue by upgrading the mentioned package? Would appreciate some feedback! 🙂 🙂

Translate