小编Sab*_*que的帖子

当我从 react-router-dom 使用重定向时,我收到 TypeError: func.apply is not a function。我是 React 和 Redux 的新手

try {
    s_product = await product.save();
    res.json(s_product);
  } catch (err) {
    console.error(err.message);
    res.status(500).send("Server Error");
}
Run Code Online (Sandbox Code Playgroud)

错误代码:

TypeError: func.apply is not a function
HTMLUnknownElement.callCallback
node_
Run Code Online (Sandbox Code Playgroud)

模块/react-dom/cjs/react-dom.development.js:337

  334 |     window.event = windowEvent;
  335 |   }
  336 | 
> 337 |   func.apply(context, funcArgs);
      | ^  338 |   didError = false;
  339 | } // Create a global error event handler. We use this to capture the value
  340 | // that was thrown. It's possible that this error handler will fire more
Run Code Online (Sandbox Code Playgroud)

任何帮助真的很感激。谢谢!

redirect react-redux react-router-dom

7
推荐指数
1
解决办法
1015
查看次数

标签 统计

react-redux ×1

react-router-dom ×1

redirect ×1