Может проблема в пути? Подскажите пожалуйста Вот что выводит вместо json
<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta\n name=\"viewport\"\n content=\"width=device-width, initial-scale=1, shrink-to-fit=no\"\n />\n <meta name=\"theme-color\" content=\"#000000\" />\n <link rel=\"manifest\" href=\"/manifest.json\" />\n <title>React App</title>\n </head>\n <body>\n <noscript>You need to enable JavaScript to run this app.</noscript>\n <div id=\"root\"></div>\n <script src=\"/static/js/bundle.js\"></script><script src=\"/static/js/0.chunk.js\"></script><script src=\"/static/js/main.chunk.js\"></script><script src=\"/main.7f626ed1f0be40d5076c.hot-update.js\"></script></body>\n</html>\n
export const getClients = () => dispatch => {
const req = new XMLHttpRequest();
req.open("GET", "./clients.json", true);
req.send();
req.onload = () => {
const clientList = JSON.stringify(req.responseText);
console.log(clientList);
dispatch({
type: "GET_CLIENTS",
payload: clientList
});
};
};