javascript - Why does @Storybook/react-native requires react-dom?
问题描述
Why does @Storybook/react-native
require react-dom
?
My understanding of react-dom
is that it is used for the browser. But, since React Native doesn't use a browser this is just a peerDependency that will never be used.
When running a React Native app with remote debugging on, it will use Chrome as the running context and have a DOM available. Is this the reason for using it?
My package.json:
"dependencies": {
...
"react": "16.3.1",
"react-native": "0.55.4",
...
},
"devDependencies": {
...
"@storybook/react-native": "4.1.1",
...
}
I get these warnings when doing yarn install
:
warning "@storybook/react-native > @storybook/core@4.1.1" has unmet peer dependency "react-dom@>=16.3.0".
warning "@storybook/react-native > @storybook/ui@4.1.1" has unmet peer dependency "react-dom@*".
warning "@storybook/react-native > @storybook/ui > react-modal@3.8.1" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0 || ^16".
warning "@storybook/react-native > @storybook/ui > react-treebeard@3.1.0" has unmet peer dependency "react-dom@^15.5.4 || ^16.0.0".
warning "@storybook/react-native > @storybook/ui > react-treebeard > velocity-react@1.4.1" has unmet peer dependency "react-dom@^15.3.0 || ^16.0.0".
解决方案
I got the following answer from Github Issue: https://github.com/storybooks/storybook/issues/5156
starting from v5 it won't need it. It is necessary so we could run web part of storybook. But the web part from v5 is going to be opt in
推荐阅读
- mariadb - 如何“重置”mariadb GLOBAL STATS?
- r - 将 RSI 函数应用于数据帧列表
- ms-access - 编写一个函数来更新标签 OnClick Access VBA
- node.js - Firebase Admin SDK - 根据服务器上的变量检查用户密码
- ios - 令牌生成/编码无法正常工作
- email - 如何通过 G-suite 从 Google Cloud 发送电子邮件
- amazon-web-services - 是否可以在 AWS Cloudformation 中指定数据格式转换?
- php - 正则表达式删除 URL 中的字符串
- azure - 无法在 azure 函数运行时 v1 中创建 python 函数应用
- json - swift json嵌套解析