Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Why React example does not use Async call to fetch json of requested page

Avatar

Avatar
Boost 1
Level 1
sumantap8752196
Level 1

Like

1 like

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile

Avatar
Boost 1
Level 1
sumantap8752196
Level 1

Like

1 like

Total Posts

10 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
View profile
sumantap8752196
Level 1

18-06-2020

I am following this tutorials: https://github.com/adobe/aem-sample-we-retail-journal

Here, all the child pages JSON is stored into __INITIAL_STATE__ id. 

I want to know why it is done in this way, can someone please explain?

Instead what if I navigate on different links and then on click of each links if I call model json of that page via Async fetch and then accordingly set __INITIAL_STATE__ id. What problem in this approach? 

AEM React JS
View Entire Topic

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,279 likes

Total Posts

3,155 posts

Correct Reply

889 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

20-06-2020

Hi,

Can you please check the latest sample project for the implementation https://github.com/Adobe-Marketing-Cloud/aem-guides-wknd-events

 

I am not a react expert so actually can't comment on approach but you can have a look to another sample SPA project from Adobe.