页面未重定向到更新 URL

Page is not redirecting to updated URL

我需要为我的应用程序重定向到新的 URL。我有一个活动要更改 URL。这里 URL 已更新,但页面未重定向。它仅在刷新后重定向。请帮我解决这个问题。谢谢

JS:

 _onNewFlowCreated(newFlow) {
        let url= '/#/flows/'+ newFlow.uid +'/edit';
        //window.history.pushState({}, '', url);
         window.location.href= url;
    }

我尝试使用 react-router。但未找到解决方案。

如果您使用的是 reactjs,请使用

browserHistory.push('/#/flows/'+ newFlow.uid +'/edit');

导航到另一个url

试试这个

import { Router, Redirect, Route, Link, browserHistory, IndexRoute, useRouterHistory, RouterContext, hashHistory } from 'react-router';
import { createHashHistory } from 'history';