Open vans163 opened 7 years ago
On second thought this maybe related to Reagent/React.JS in general and orders of events. But I fixed it by using the JS HistoryAPI directly and triggering the first route (after page load) by subscribing to
(js/window.addEventListener "DOMContentLoaded" #())
I ran into the same issue at first, but was able to fix it by making sure I always dispatch only after the routes have been declared.
First time a page loads there is no dispatch. For example my SPA has a certain component to display if they are on /login, the app determines that by a dispatch on secretary navigate. When you navigate directly to /login secretary fails to trigger the dispatch.