User profile is not available

I am following the GitHub - auth0-samples/auth0-react-samples: Auth0 Integration Samples for React Applications (see 02-User-Profile sample),
in this sample, getProfile is used to retrieve the user information.
The username is then used to call Redux actions, but the username is not immediately available and hence, the Redux actions fail.
How could I ensure that the pages are loaded only after the getProfile has been run and userProfile info is available? I am using React Router 4.

I checked the linked sample and also the React quickstart and could not locate the part about username being used in actions. I might have missed something, but assuming you’re extending beyond the sample code and you’re looking for React specific advice about possible ways to handle asynchronous operations within your application then I suggest you to use more general Q&A site like StackOverflow where knowledge on React surpasses the one found on a site specific to authentication and authorization services. From a quick research it seems this might be relevant: Redux Fundamentals, Part 6: Async Logic and Data Fetching | Redux