0

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')

One of the pull requests on the project adds the ListView functionality I need.

How do I add this PR to my own project?

What I have tried:

  1. 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. The way one normally installs React-Native-Web is npm install --save [email protected] [email protected] react-native-web and I tried npm install https:https://github.com/mcampsall/react-native-web

  2. adding the files directly to my /dist folder. This did not work because I needed the babel translated versions of the files. 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.

Thanks in advance.

EDIT: I just tried npm install --save [email protected] [email protected] https://github.com/mcampsall/react-native-web as per Molda's suggestion and got:

├── [email protected]  extraneous
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── UNMET PEER DEPENDENCY [email protected]
├── UNMET PEER DEPENDENCY [email protected]
└─┬ [email protected]  (git+https://github.com/mcampsall/react-native-web.git#b448fb94cb29d08057eb72e4c13d09ad808f719a)
  ├─┬ [email protected] 
  │ └── [email protected] 
  └── [email protected] 

npm WARN [email protected] requires a peer of react@^15.1.0 but none was installed.
npm WARN [email protected] requires a peer of react-dom@^15.1.0 but none was installed.

EDIT 2: tried npm install --save [email protected] [email protected] https://github.com/mcampsall/react-native-web and when i do this i get an error npm WARN [email protected] 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)...?

I then tried installing [email protected] and it showed the original error again npm WARN [email protected] requires a peer of react@^15.1.0 but none was installed.

Community
  • 1
  • 1
Michael Campsall
  • 4,325
  • 11
  • 37
  • 52

1 Answers1

3

I just tried this

npm install --save [email protected] [email protected] git+https://[email protected]/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

Molda
  • 5,619
  • 2
  • 23
  • 39