未定义'globalThis'

时间:2020-09-12 06:08:49

标签: reactjs

这是我的代码

const Darko = () => {
  const history = useHistory();
  const [logout, { loading, error }] = useMutation(LOGOUT, {
    onCompleted: () => {
      history.push("/");
      globalThis.location.reload();
    },
    fetchPolicy: "no-cache",
  });
  return <div>...</div>}

为什么会出现错误“ globalThis”未定义

0 个答案:

没有答案