reactjs - 既找不到样式组件的秘密内部结构
问题描述
我目前正在尝试更新到 Styled Components 5.0.0,但我遇到了一些问题,我的 JEST 测试停止工作。我已经降级到 4.2.1,但仍然更新了 babel@preset-react、preset-env、core 和其他一些包。当我尝试运行 npm test 时出现此错误:
“找不到样式组件的秘密内部”,它指向import 'jest-styled-components';
Jest 样式组件也更新到 7.0.0
解决方案
https://github.com/styled-components/jest-styled-components/issues/301#issuecomment-893170436
改成 yarn add jest-styled-components@6.3.4 解决问题。
推荐阅读
- vue.js - configureWebpack 功能模式 如何配置 unplugin-vue-components 插件?
- windows - 通过 Windows 10 的上下文菜单将选定的多个文件名传递给 exe 文件的单个实例
- google-api - 在 Google Campaign 360 中调用 conversions.batchInsert 时出现“找不到 MatchID”错误
- opencv - opencv_annotation(-204:未找到请求的对象)
- c# - WebApi 部署问题应用程序'MACHINE/WEBROOT/APPHOST/
- matlab - 无法在 MATLAB 中创建符号变量 n 行 1 列
- forms - 是否可以在 MS 表单中显示自定义文本超链接?
- c++ - 如何将此 JavaScript 代码转换为 C++
- javascript - 防止点击 React-Fiber Three.js 中的对象
- python - 如何在python中计算汇总值