I’ve created some React files where one initializes a Redux store. However, I really need to load some data from a json file before store is initialized.
I’ve tried to import a script loading the json structure then assigning it to the createStore initialState value. But createStore runs before the data is loaded and assigned.
Is there any simple way to say “dont do anything before my axios call is done”???
Action types actiontypes.js
Actions
actions.js
use this in reducers that requires
You just need the first screen of your application on componentWillMount() call the loadData() action
I hope this can help you