Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No dispatch upon page load #88

Open
vans163 opened this issue Nov 11, 2016 · 2 comments
Open

No dispatch upon page load #88

vans163 opened this issue Nov 11, 2016 · 2 comments

Comments

@vans163
Copy link

vans163 commented Nov 11, 2016

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.

@vans163
Copy link
Author

vans163 commented Dec 19, 2016

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" #())

@dchacke
Copy link

dchacke commented Nov 23, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants