Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

withMappable wraps React component with an additional div

Avatar

Level 1

Whenever we are using withMappable in our React SPA, that component is wrapped with an additional div.

 

Example:-

withMappable of Test component results in the following DOM tree,

 

.

.

.

div (the additional div which was not added by us)

  Test

div

.

.

.

 

Is there any way to configure withMappable to not wrap our component with an additional div? 

2 Replies

Avatar

Community Advisor

Hi,

Is it in only in Author or see div in the publish as well?



Arun Patidar

Avatar

Level 1

The extra wrapping div can be seen in both the publish and author instances.

 

The extra wrapping div, you see is being added by the withMappable function and not by us in our React SPA. Moreover, at the end of the div, there is an empty div. (<div></div>)

 

suryanshABG_0-1683782090727.png