Why React example does not use Async call to fetch json of requested page | Community
Skip to main content
Level 2
Jun 18, 2020 2:32 PM UTC
Solved

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

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? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 20, 2020 4:10 PM UTC

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.

Arun Patidar

4 replies

Level 2
Jun 23, 2020 9:02 AM UTC

I do not understand why you guys accept wrong answer as correct answer!!!!! crazy

Translate
kautuk_sahni
Employee
Jun 24, 2020 7:50 AM UTC
Thank you for the feedback. we have marked it as incorrect.
Translate
Kautuk Sahni
arunpatidar
arunpatidarAccepted solution
New Participant
Jun 20, 2020 4:10 PM UTC

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.

Translate
Arun Patidar
Level 2
Jun 22, 2020 7:15 AM UTC
thanks, yes i know
Translate