a = await fetch("https://ega.bet/bets?ajax=&st=0&ut=0&f=", {"credentials":"include","headers":{"accept":"application/json, text/javascript, */*; q=0.01","accept-language":"en-US,en;q=0.9","cache-control":"no-cache","pragma":"no-cache","x-csrf-token":"stgtVCEQDZW6ATbIo2sBBFor6yXyHwEstZsxELKcLhOcWN5jqJgK9xLPKuvc8KzdR5XJT5/ap8RFG25ZPHXkBg==","x-egb-locale":"ru","x-newrelic-id":"VQ4FV19XCRAJUlVVAQAEVw==","x-requested-with":"XMLHttpRequest"},"referrer":"https://ega.bet/","referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"GET","mode":"cors"});
// Response {type: "basic", url: "https://ega.bet/bets?ajax=&st=0&ut=0&f=", redirected: false, status: 200, ok: true, …}
await a.json()
// {user_time: 1564574569, ut: 0, bets: Array(150), nested_bets: Array(723)}
a = await fetch("https://ega.bet/bets?ajax=&st=0&ut=0&f=", {
"headers": {
"accept":"application/json, text/javascript, */*; q=0.01",
"x-requested-with":"XMLHttpRequest"
}
});
await a.json()
Проблема в том что при каждом смене url меню обновляется сменяя активный класс
<main>
<LeftMenu />
<Switch>
<Route path='/dashboards/1' component={Dash1} />
<Route path='/dashboards/2' component={Dash2} />
...
</Switch>
</main>