Adobe-Marketing-Cloud / aem-guides-wknd-events

Step by Step guide to creating a Single Page Application to use with AEM
48 stars 34 forks source link

React Router Question #50

Closed Harishv57 closed 5 years ago

Harishv57 commented 5 years ago

I have been working on spa with react in aem. In edit - preview mode, list url are routed without updating the page url. Behavior: By removing editor.html ,it update the url while routing .

Question :

I need to route to the aem pages without updating the url. Just the content should update. How to proceed in this spa editor.where to handle ?

godanny86 commented 5 years ago

hi @Harishv57 I would need to investigate further but I would look into using the HashRouter

and updating the code at https://github.com/Adobe-Marketing-Cloud/aem-guides-wknd-events/blob/react/chapter-3/react-app/src/index.js#L12 and the withRoute HOC: https://github.com/Adobe-Marketing-Cloud/aem-guides-wknd-events/blob/react/chapter-3/react-app/src/utils/RouteHelper.js#L17

I'm not sure what will happen with the AEM editor if using a HashRouter though...

godanny86 commented 5 years ago

hi @Harishv57 since this is not directly related to the tutorial I'm going to close this issue.