[OtherGlobalError.window.onerro]不变违反:无效的挂钩调用

时间:2020-02-25 20:24:16

标签: react-hooks spfx

我正在使用带有钩子的React组件开发SharePoint Web部件。 一个组成部分是项目列表(数据网格) 我想在行上单击(或输入或按钮)以打开另一个组件中的模式对话框或面板。 我尝试了使用Dialog的Kendo Grid和使用Modal和Panel的office-ui-fabric-react的DetailsList

我总是会收到错误消息:

[1582660740065][OtherGlobalError.window.onerro] Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component. backend.js:6 [1582660740065][OtherGlobalError.window.onerro] Invariant Violation: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See "fb.me/react-invalid-hook-call" for tips about how to debug and fix this problem.

我仍然在代码中看到问题 有没有人有一个列表行调用对话框的示例(不是alert) 谢谢

0 个答案:

没有答案