[英]How do I properly include a pull request on github into my build of React-Native-Web?
I am trying to make use of React-Native-Web , but the master branch version of ListView gives the error: TypeError: undefined is not a constructor (evaluating 'new _reactNative.ListView.DataSource')
我正在尝试使用React-Native-Web ,但是ListView的主分支版本给出了错误:
TypeError: undefined is not a constructor (evaluating 'new _reactNative.ListView.DataSource')
One of the pull requests on the project adds the ListView functionality I need. 在项目上的拉取请求之一添加了我需要的ListView功能。
How do I add this PR to my own project? 如何将此PR添加到我自己的项目中?
What I have tried: 我试过的
created my own fork and manually added the files then tried to use npm to load it directly as per this SO question , it did not work, key core components were missing. 创建了我自己的fork并手动添加了文件,然后按照此SO问题尝试使用npm直接加载它,它不起作用,缺少关键的核心组件。 The way one normally installs React-Native-Web is
npm install --save react@0.14 react-dom@0.14 react-native-web
and I tried npm install https:https://github.com/mcampsall/react-native-web
通常安装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
adding the files directly to my /dist folder. 将文件直接添加到我的/ dist文件夹中。 This did not work because I needed the babel translated versions of the files.
这没有用,因为我需要文件的babel翻译版本。 I tried to use the babel REPL to translate them, but it is missing some plugins and gets hung up on certain parts of the code.
我尝试使用babel REPL来翻译它们,但是它缺少一些插件,并且挂在代码的某些部分。
Thanks in advance. 提前致谢。
EDIT: I just tried npm install --save react@0.14 react-dom@0.14 https://github.com/mcampsall/react-native-web
as per Molda's suggestion and got: 编辑:我只是
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.
EDIT 2: tried npm install --save react@15.1.0 react-dom@15.1.0 https://github.com/mcampsall/react-native-web
and when i do this i get an error npm WARN react-native@0.23.1 requires a peer of react@^0.14.5 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.
which is a different version of react-native-web
(0.23.1) than the original error (which was 0.25)...? 这是不同于原始错误(0.25)的版本的
react-native-web
(0.23.1)...?
I then tried installing react@14.5 and it showed the original error again npm WARN react-native-web@0.0.25 requires a peer of react@^15.1.0 but none was installed.
然后我尝试安装react@14.5,它再次显示原始错误
npm WARN react-native-web@0.0.25 requires a peer of react@^15.1.0 but none was installed.
I just tried this 我刚试过
npm install --save react@15.1.0 react-dom@15.1.0 git+https://git@github.com/mcampsall/react-native-web
and it installs without any error. 并且它安装没有任何错误。
Make sure you delete all the packages before you install again or try to install into new empty folder 确保在再次安装之前删除所有软件包,或尝试安装到新的空文件夹中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.