kauffecup / react-native-web-hello-world

An example HelloWorld app that shares code between React Web and React Native

Home Page:http://jkaufman.io/react-web-native-codesharing/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm run ios-bundle has error: Unable to resolve module ReactUpdates

ngduc opened this issue · comments

npm run ios-bundle has error: Unable to resolve module ReactUpdates

I followed this guide then it works fine.
http://stackoverflow.com/questions/40730787/unable-to-resolve-module-react-lib-reactupdates

(pinned react to: "react": "~15.3.2")
Can this be fixed? Thanks.

If you do not pin it to react 15.3.x , I had to do the following steps:

  1. upgrade react-native in package.json
"dependencies": {
    ...
    "react-native": "^0.42.0",
    ...
  },
  1. run npm install or yarn

  2. run react-native upgrade in terminal

  3. Answered y to all (Do you want to replace ...? questions. About 10 times.)

  4. make sure gradle version is updated in android/gradle/wrapper/gradle-wrapper.properties: changed the distributionUrl to distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

  5. update index.android.js (change the first line):
    import React, { Component, AppRegistry } from 'react-native'; to import React, { Component } from 'react'; import { AppRegistry } from 'react-native';

  6. run react-native run-ios or react-native run-android or npm run web-dev to see the app working.

Anyone knows if there is actually something useful that has been overwritten? It didn't seem to be the case.

Alternatively I tried to react-native-git-upgrade. That changed files... but then when it patched the files reverted to the state prior to the upgrade. So the errors were not resolved.