繁体   English   中英

如何在我的React-Native-Web构建中正确包含对github的拉取请求?

[英]How do I properly include a pull request on github into my build of React-Native-Web?

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

在项目上的拉取请求之一添加了我需要的ListView功能。

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

我试过的

  1. 创建了我自己的fork并手动添加了文件,然后按照此SO问题尝试使用npm直接加载它,它不起作用,缺少关键的核心组件。 通常安装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来翻译它们,但是它缺少一些插件,并且挂在代码的某些部分。

提前致谢。

编辑:我只是npm install --save react@0.14 react-dom@0.14 https://github.com/mcampsall/react-native-web的建议尝试了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 requires a peer of react@^0.14.5 but none was installed. 这是不同于原始错误(0.25)的版本的react-native-web (0.23.1)...?

然后我尝试安装react@14.5,它再次显示原始错误npm WARN react-native-web@0.0.25 requires a peer of react@^15.1.0 but none was installed.

我刚试过

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

并且它安装没有任何错误。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM