Skip to content

undefined is not an object (evaluating '_react2.default.addons.batchedUpdates') #76

New issue

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

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

Already on GitHub? # to your account

Closed
hyperh opened this issue May 27, 2016 · 4 comments

Comments

@hyperh
Copy link

hyperh commented May 27, 2016

I'm getting the following error

undefined is not an object (evaluating '_react2.default.addons.batchedUpdates')

on versions

    "react": "15.0.2",
    "react-native": "0.26.2",
    "react-native-meteor": "1.0.0-rc4",

I believe this is due to the following lines of code
https://github.com/inProgress-team/react-native-meteor/blob/master/src/Data.js#L1
https://github.com/inProgress-team/react-native-meteor/blob/master/src/Data.js#L7

react-native 0.26.x requires you to do import React from 'react' rather than react-native. However, when I try to import from react, I get the same error. I think this issue is related facebook/relay#127

Based on https://github.com/facebook/react-native/blob/26e84262484767dd9abdfd78ff16fa37fcb8e334/Libraries/react-native/react-native.js#L155

I tried to do

import ReactNative from 'react-native

db.batchedUpdates = ReactNative.batchedUpdates;

But I get the error

Unable to get cookie from the https://myapp.com/websocket
@Mokto
Copy link
Contributor

Mokto commented May 27, 2016

Hi @hyperh,

Thanks for reporting. I just got this error too when testing on Android.
On iOS everything works fine !

I replace RN.addons.batchedUpdates by db.batchedUpdates = ReactNative.unstable_batchedUpdates; and the warning message is not here anymore.

But

Unable to get cookie from the https://myapp.com/websocket

is what I get too and I do not think it is related to batchedUpdates.

I think I will create an issue on react-native repo, what do you think ?

@Mokto
Copy link
Contributor

Mokto commented May 27, 2016

Closing this one in favour of #77

@Mokto Mokto closed this as completed May 27, 2016
@hyperh
Copy link
Author

hyperh commented May 28, 2016

@Mokto Yea perhaps an issue on react-native repo would help. I'm having trouble understanding this error as well.

@txs
Copy link

txs commented May 13, 2017

Have you solve the issue? @hyperh

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

No branches or pull requests

3 participants