Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error on react native 45 and react 16-alpha.12 #1866

Closed
sibelius opened this issue Jun 7, 2017 · 13 comments
Closed

error on react native 45 and react 16-alpha.12 #1866

sibelius opened this issue Jun 7, 2017 · 13 comments

Comments

@sibelius
Copy link
Contributor

sibelius commented Jun 7, 2017

I'm using react-relay 1.0.0
I've upgraded my react native code to RN 45, and it is throwing the following error:

image

in this line: require('./relayUnstableBatchedUpdates')

var mounted = _this3.mounted;
        if (mounted) {
          var updateProfiler = require('./RelayProfiler').profile('RelayContainer.update');
          require('./relayUnstableBatchedUpdates')(function () {
            _this3.setState(partialState, function () {
              updateProfiler.stop();
              if (isComplete) {
                completeProfiler.stop();
              }
            });
            if (callback) {
              callback.call(
              // eslint-disable-next-line react/no-string-refs
              _this3.refs.component || null, (0, _extends3['default'])({}, readyState, { mounted: mounted }));
            }
          });
        } else {
@joonhocho
Copy link

joonhocho commented Jun 10, 2017

I am still using react-relay/classic, and I just upgraded react-native to v0.45.1 and I started getting the following error:

this._batchUpdate is not a function.

The same error occurs both on [email protected] and [email protected].

simulator screen shot jun 9 2017 8 55 17 pm

@lprhodes
Copy link

Seeing this too - have you found any work-arounds?

@juhaelee
Copy link

@joonhocho I'm also getting this error, did you resolve it?

@joonhocho
Copy link

@lprhodes @juhaelee Not yet. For now, I just downgraded my react-native.

@alloy
Copy link
Contributor

alloy commented Jun 14, 2017

I have fixes for this in a branch that I’m updating as I go through upgrading our app. I’ll move extract these to a PR later today.

@alloy
Copy link
Contributor

alloy commented Jun 14, 2017

Please give #1889 a try (I’m not yet done with the conversion of our app)

@yungsters
Copy link
Contributor

yungsters commented Jun 19, 2017

@spicyj helped me debug this. So relayUnstableBatchedUpdates.native.js does the following:

const ReactNative = require('ReactNative');

module.exports = ReactNative.unstable_batchedUpdates;

However, ReactNative gets mapped to react-native which, according to the react-native/package.json, is actually (and confusingly) react-native-implementation.js.

Notice that react-native-implementation.js does not currently export unstable_batchedUpdates, which means that relayUnstableBatchedUpdates is likely coming up as undefined.

@sibelius or @alloy, can you try modifying react-native-implementation.js to export unstable_batchedUpdates and see if this resolves the bug? If so, either you can send a pull request or I can make the change to export it.

Separately, we really need to rename ReactNative.js to something else (e.g. ReactNativeRenderer.js) and rename react-native-implementation.js to ReactNative.js. But that's a separate issue.

@sophiebits
Copy link
Contributor

and rename react-native-implementation.js to ReactNative.js. But that's a separate issue.

To be fair, I suggested ReactNativeEverythingBagel.js.

@yungsters
Copy link
Contributor

@sibelius or @alloy, can either of you see if facebook/react-native@5550a25 helps?

@joenoon
Copy link

joenoon commented Jul 2, 2017

@yungsters facebook/react-native@5550a25 worked for me so far. I'm in the middle of a big upgrade, so possible I'll run into something else, but so far so good!

@gre
Copy link

gre commented Jul 3, 2017

facebook/react-native@5550a25 works great

@alloy
Copy link
Contributor

alloy commented Aug 14, 2017

@yungsters Been a while, our migration was on hold. I can confirm that that patch fixes the issue 👍

@yungsters
Copy link
Contributor

Perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants