gpt4 book ai didi

javascript - 如何正确地将 github 上的拉取请求包含到我的 React-Native-Web 构建中?

转载 作者:太空宇宙 更新时间:2023-11-04 03:31:00 25 4
gpt4 key购买 nike

我正在尝试利用React-Native-Web ,但 ListView 的 master 分支版本给出错误: TypeError: undefined is not a constructor (evaluating 'new _reactNative.ListView.DataSource')

pull requests 之一在项目上添加了我需要的ListView功能。

如何将此 PR 添加到我自己的项目中?

我尝试过的:

  1. 已创建my own fork并手动添加文件,然后尝试使用 npm 按照此直接加载它 SO question ,它不起作用,关键核心部件丢失。通常安装React-Native-Web的方式是npm install --save react@0.14 react-dom@0.14 react-native-web,我尝试了npm install https:https://github.com/mcampsall/react-native-web

  2. 将文件直接添加到我的/dist 文件夹中。这不起作用,因为我需要文件的 babel 翻译版本。我尝试使用 babel REPL来翻译它们,但它缺少一些插件并且在代码的某些部分上挂起。

提前致谢。

编辑:我刚刚按照 Molda 的建议尝试了 npm install --save react@0.14 react-dom@0.14 https://github.com/mcampsall/react-native-web 并得到:

├── babel@6.5.2  extraneous
├── babel-plugin-transform-decorators@6.8.0
├── babel-plugin-transform-decorators-legacy@1.3.4
├── babel-preset-react@6.5.0
├── UNMET PEER DEPENDENCY react@0.14.8
├── UNMET PEER DEPENDENCY react-dom@0.14.8
└─┬ react-native-web@0.0.25 (git+https://github.com/mcampsall/react-native-web.git#b448fb94cb29d08057eb72e4c13d09ad808f719a)
├─┬ fbjs@0.8.3
│ └── object-assign@4.1.0
└── react-textarea-autosize@4.0.3

npm WARN react-native-web@0.0.25 requires a peer of react@^15.1.0 but none was installed.
npm WARN react-native-web@0.0.25 requires a peer of react-dom@^15.1.0 but none was installed.

编辑2:尝试npm install --save react@15.1.0 react-dom@15.1.0 https://github.com/mcampsall/react-native-web,当我这样做时,我收到错误npm WARN react-native@0.23.1需要react@^0.14.5的同级,但没有安装。这是react-native-web的不同版本(0.23.1) 比原始错误(0.25)...?

然后我尝试安装react@14.5,它再次显示原始错误npm WARN react-native-web@0.0.25需要react@^15.1.0的同级,但没有安装。

最佳答案

我刚刚尝试过

npm install --save react@15.1.0 react-dom@15.1.0 git+https://git@github.com/mcampsall/react-native-web 

安装后没有任何错误。

请确保在再次安装之前删除所有软件包或尝试安装到新的空文件夹中

关于javascript - 如何正确地将 github 上的拉取请求包含到我的 React-Native-Web 构建中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37998190/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com