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:
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 react@0.14 react-dom@0.14 react-native-web
and I triednpm install https:https://github.com/mcampsall/react-native-web
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 react@0.14 react-dom@0.14 https://github.com/mcampsall/react-native-web
as per Molda's suggestion and got:
├── 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.
which is a different version of react-native-web
(0.23.1) than the original error (which was 0.25)...?
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.