Reactjs 在React路由器dom导航上获取错误无法执行';插入前';在';节点?

Reactjs 在React路由器dom导航上获取错误无法执行';插入前';在';节点?,reactjs,react-router-dom,Reactjs,React Router Dom,我使用的是react版本16.4.2和react路由器dom 4.3.1。调用history.push方法时出现此错误 无法在“节点”上执行“insertBefore”:在该节点之前 要插入的新节点不是此节点的子节点 这就是我在authContext组件中所做的 export default withAuthContext(withRouter(injectIntl(ServiceOperatorForm))); import React from "react"; const AuthCo

我使用的是react版本16.4.2和react路由器dom 4.3.1。调用history.push方法时出现此错误

无法在“节点”上执行“insertBefore”:在该节点之前 要插入的新节点不是此节点的子节点

这就是我在authContext组件中所做的

export default withAuthContext(withRouter(injectIntl(ServiceOperatorForm)));
import React from "react";

const AuthContext = React.createContext({ authorized: false });

export const withAuthContext = Component => {
  return props => (
    <AuthContext.Consumer>
      {value => <Component {...props} authContext={value} />}
    </AuthContext.Consumer>
  );
};

export default  AuthContext;
从“React”导入React;
const AuthContext=React.createContext({authorized:false});
导出常量withAuthContext=Component=>{
返回道具=>(
{value=>}
);
};
导出默认AuthContext;

您可以将参数
{pathname:“/serviceoperators/form”}
传递到推送功能,并使用withRouter包装组件。

发布一些代码可能会帮助人们正确回答您。请再次查看问题。我已经在使用withRouter包装组件,它工作正常,但突然显示此错误。
import React from "react";

const AuthContext = React.createContext({ authorized: false });

export const withAuthContext = Component => {
  return props => (
    <AuthContext.Consumer>
      {value => <Component {...props} authContext={value} />}
    </AuthContext.Consumer>
  );
};

export default  AuthContext;