score:15

Accepted answer

I meet the similar problem before.I create my react app by create-react-app command.And find that you can only get the static file from the public folder.If you want to the get "db.json",you should put the "db.json" into the public folder.

score:3

I know that this question is answered long back. It will help people like me. Instead of using axios or other network libraries you can directly import the json file like below and return it in dispatcher. If you are using local json to test it why do you need network libraries.

import data from './response.json'

export function initializeApp() {
  return function (dispatch) {
    dispatch({
      type: ActionTypes.ActionName,
      payload: data
    });

  }
}

Related Query

More Query from same tag