I want to load something from my API endpoint in componentDidMount
, but that needs to have something else from the redux store passed into it.
Thing is, it seem that componentDidMount gets fired before the props are populated from redux, so the jwt auth token isn't in the redux state yet, and I get a 401 error.
How can I get the code to wait for the redux state to be loaded, then call the function, or have it loop every, lets say 500ms, until the props are identified?
If there's some place other than componentDidMount
I should put it I'm open to suggestions.