How to Share React components across multple applications with AEM SPA

Avatar

Avatar
Validate 1
Level 1
arunaaems506124
Level 1

Like

1 like

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
arunaaems506124
Level 1

Like

1 like

Total Posts

25 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Ignite 1
Give Back
Boost 1
Applaud 5
View profile
arunaaems506124
Level 1

26-05-2020

Hi All,

 

I have 3 AEM SPA react applications within the same AEM repository. All these 3 applicaitions using AEM SPA React framework. Lets say AEM SPA react app a1, a2, a3. these a1, a2,a3 apps generate with maven acrhetype AEM SPA 4.0. As you all know that when we want to create any new component we need to map the specific component to AEM react app page component to display on the page.

My requirement is to re-use the components a1 app in a2 and a3. without mapping these components I am not able to re-use them in the AEM application. 

 

are there any other ways to resolve this issue?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile

Avatar
Boost 250
MVP
Nikhil-Kumar
MVP

Likes

251 likes

Total Posts

262 posts

Correct reply

38 solutions
Top badges earned
Boost 250
Validate 1
Ignite 3
Ignite 1
Give Back 5
View profile
Nikhil-Kumar
MVP

24-08-2020

@arunaaems506124 

In AEM SPA architecture every react component to every AEM component. So it's one to one mapping.
In your case as you have a new project under /apps then you need to create a new one to one mapped component once again.

One way is adding the component from first app to second app by updating the page policies (This should solve your issue of reusing the components)

Thanks,
Nikhil 

Answers (0)