I have page with tabs.
{
path: '/settings/monitoring/:tab',
component: MonitoringPage,
exact: true,
type: PRIVATE_TYPE,
},
There is useEffect
, which get data for all tabs. There is function, which change tab:
const onChangeTab = (tabName) => {
const tab = findTab(tabName)
props.history.push(tab.settings.name, null)
setSettings(tab.settings)
}
history.push
change link, but also rerender app and useEffect
work again. History push need to have access to tabs with link, how can I fix it, but have access to tabs with link?