adobe / aem-spa-project-archetype

Maven Archetype for creating new AEM SPA projects
Apache License 2.0
61 stars 32 forks source link

[React] use Router instead of BrowserRouter #67

Closed ittaibaratz closed 5 years ago

ittaibaratz commented 5 years ago

This is needed in order to allow using the history object to programmatically move between routes.

This is a simple change, and I'll provide a PR when I get to it. It is explained properly here.

Essentially we need to change the following in index.js: `

), document.getElementById('page'));`

to ` const history=createBrowserHistory(); ...

`

This will give access to the history object, allowing it to update routes as a result of state changes.

lydiapuric commented 5 years ago

@ittaibaratz Thanks for using the archetype and your effort to report the issues. Your proposed improvement sounds good. Looking for your contribution.

ittaibaratz commented 5 years ago

Thanks @lydiapuric , pull request created.