React App 中的 Drizzle 组件 - 无法读取未定义的属性。上述语句出现在中。成分
我正在尝试在React应用程序中使用毛毛雨,以显示前端的智能合约详细信息。然而,该错误遇到了这个错误,说
drizzle-react-components.js:1
Uncaught TypeError: Cannot read properties of undefined (reading 'methods')
at new o
` Further errors in console
` 8index.js:1
The above error occurred in the <o> component:
at o (http://localhost:3000/static/js/vendors~main.chunk.js:466:9)
at div
at div
at http://localhost:3000/static/js/main.chunk.js:198:7
at LoadingContainer (http://localhost:3000/main.0b8989a9c050f470ba10.hot-update.js:35:5)
at v (http://localhost:3000/static/js/vendors~main.chunk.js:2751:19)
at div
at App
加载容器是由我创建的,这是该脚本的内容,
import React from "react";
import { drizzleReactHooks } from "@drizzle/react-plugin";
const { useDrizzleState } = drizzleReactHooks;
function LoadingContainer({children}) {
const drizzleStatus = useDrizzleState(state => state.drizzleStatus);
if(drizzleStatus.initialized === false) {
return "Loading ...";
}
return (
<>
{children}
</>
)
}
export default LoadingContainer;
任何指针如何重新安装此脚本,我真的陷入了这个问题。
谢谢
松露 反应 细雨
I am trying to use Drizzle inside a React App to show the smart contract details in the front end. However stuck at this error, which says
drizzle-react-components.js:1
Uncaught TypeError: Cannot read properties of undefined (reading 'methods')
at new o
` Further errors in console
` 8index.js:1
The above error occurred in the <o> component:
at o (http://localhost:3000/static/js/vendors~main.chunk.js:466:9)
at div
at div
at http://localhost:3000/static/js/main.chunk.js:198:7
at LoadingContainer (http://localhost:3000/main.0b8989a9c050f470ba10.hot-update.js:35:5)
at v (http://localhost:3000/static/js/vendors~main.chunk.js:2751:19)
at div
at App
The Loading Container is created by me, and this is the content of this script
import React from "react";
import { drizzleReactHooks } from "@drizzle/react-plugin";
const { useDrizzleState } = drizzleReactHooks;
function LoadingContainer({children}) {
const drizzleStatus = useDrizzleState(state => state.drizzleStatus);
if(drizzleStatus.initialized === false) {
return "Loading ...";
}
return (
<>
{children}
</>
)
}
export default LoadingContainer;
Any pointer how to resole this, I am really stuck with this issue.
Thanks
truffle
react
drizzle
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论