I'm trying to make a WordPress theme, with React + Redux. I'm using this Wp + React + Redux theme as an example: https://github.com/jackreichert/a-wp-react-redux-theme.
On the homepage I fetch all the posts with the WordPress API link. When I click on a post, I'm mounting another component, which fetches the content of just one single post with the WordPress API link. But the router goes to the other component, BEFORE the new content is fetched. So when I'm going from the Home component to the SinglePost component, it still displays all posts below eachother (for like 0.5seconds) untill Redux has Fetched the one single post.
How can I solve this issue? I've already tried to add Thunk and Promise, and I assume i've done it the right way.
You can see my current version at http://react-test.friendsagency.com/, and if you navigate through the routes you probably will understand what my problem is.
You can see my code on https://github.com/ludovers/wp-react-redux.
If you see jackreichert's example, you can see that after you click a route, it navigates to the component after redux has finished fetching the data. But I dont see many differences between his and my code.
I hope you understand my problem, and I hope someone can help me solve this issue.
Thanks!