react-native - TypeError:在 React Native 上使用 StorybookJS 将循环结构转换为 JSON
问题描述
每当我在 Storybook Navigator 中导航到新故事时,都会发生这种情况。谢谢!
ExceptionsManager.js:126 Unhandled JS Exception: TypeError: Converting circular structure to JSON
--> starting at object with constructor 'HooksContext'
| property 'currentContext' -> object with constructor 'Object'
--- property 'hooks' closes the circle
我正在使用React Native
0.61.5
和@storybook/react-native
5.3.9
解决方案
我正在处理同样的问题,不幸的是没有足够的 Storybook 或 React Native 经验来诊断。
但是,我能够按照https://github.com/storybookjs/storybook/issues/9294中的描述修补模块,即“hooks.currentContext = Object.assign({}, context, { hooks: null }); "
重申一下,这不是一个完美的解决方案,因为原始错误来自 currentContext 和钩子之间的嵌套循环关系。这只是将钩子设置为 null 以终止循环结构。
推荐阅读
- javascript - JavaScript 中的倒数计时器,只打印素数
- object - 如何在铯地图上获取点击图标的位置
- vaadin - Vaadin 热图不支持 40x40 (1600) 点?
- java - 在 Magnolia CMS 中注册自定义 VirtualUriMapper
- php - 商品价格低于折扣金额时的 Woocommerce 优惠券折扣
- python - 使用递归的 Python 特殊嵌套列表
- python - 根据资源文件在任何地方执行python cli
- node.js - 将 secp256k1 与 ECDSA 算法一起使用时,grpc 节点相互身份验证失败
- visual-studio - 编写一个 VS 扩展并希望在我正在悬停的编辑器中获得 C# 文本的完全限定类型
- python - 多处理:池:直接迭代器或使用变量来存储迭代器