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

React Native 0.8.0-rc Error #11

Open
MossP opened this issue Jul 13, 2015 · 12 comments
Open

React Native 0.8.0-rc Error #11

MossP opened this issue Jul 13, 2015 · 12 comments

Comments

@MossP
Copy link

MossP commented Jul 13, 2015

Great Plugin. Just a heads up:
In React Native 0.8.0-rc an error occurs as soon as the package is installed to node_modules regardless if it has been implemented or added to the xcode project.

Errors thrown up are deceiving as they point to every other module as the cause of the error but removing all and adding back one at a time shows this as the faulting module.

@aljs
Copy link
Contributor

aljs commented Jul 13, 2015

There are changes in native module declaration in fresh RN versions. Try this small fix:
#10

@MossP
Copy link
Author

MossP commented Jul 13, 2015

Thanks @aljs I'll take a look now. Looks like there are a few components falling foul of this.

@MossP
Copy link
Author

MossP commented Jul 13, 2015

That doesn't appear to be enough to fix it. I still get a multitude of other seemingly unrelated errors as soon as this component in present in the node_modules folder.

undefined is not an object (evaluating 'RCTScrollViewConsts.KeyboardDismissMode.None')

I know the constants have changed in 0.8 so that may the cause. A quick attempt to re-align the variables failed but I'll dig further into it and see what I find.

@MossP
Copy link
Author

MossP commented Jul 13, 2015

ok, it also fails because it has react-native in its own node_modules folder, removing that at least allows the project to run and changing the require to

var RCTRefreshControl = require('NativeModules').RefreshControl;

gets closer but it still fails as soon as RCTRefreshControl.configure() is called.

I'll come back to this....

@MossP
Copy link
Author

MossP commented Jul 14, 2015

Since applying the update the component generally works but frequently triggers this error facebook/react-native#1941 Disabling this component removes the error. App will frequently fail to load initially then after pressing "reload" from the React Native debug red screen it will eventually load. Seems not to happen once bundled to the device though.

@aljs
Copy link
Contributor

aljs commented Jul 16, 2015

@MossP, i fixed this error ("Cannot find view with tag") by adding timeout before:

componentDidMount() {
  setTimeout(() => {
    RCTRefreshControl.configure({
      node: this.refs[SCROLLVIEWREF],
      tintColor: '#cccccc',
      activityIndicatorViewColor: '#cccccc'
    }, () => {
      this.forceUpdate();
      RCTRefreshControl.endRefreshing(this.refs[SCROLLVIEWREF]);
    }) 
  }, 100);
},

@MossP
Copy link
Author

MossP commented Jul 22, 2015

ah, @aljs.. good call. Thanks for letting me know :)

@thekennysong
Copy link

@aljs Nice work! Was wondering what you set SCROLLVIEWREF equal to? 'ScrollView'?

@MossP
Copy link
Author

MossP commented Sep 1, 2015

@thekennysong You set it to match the ref of your scrollview.

@RoboTeddy
Copy link

The underlying bug should be fixed by (facebook/react-native#2488), so this workaround should hopefully be unnecessary when the next version comes out!

@thekennysong
Copy link

@MossP I still have no luck with getting the refresh to work for ScrollView. I tried both @aljs code snippet above and the code in the README. Any suggestions?

@MossP
Copy link
Author

MossP commented Sep 2, 2015

Great news @RoboTeddy, thank you for that 👍 I look forward to it vanishing completely!

@thekennysong Are we talking about the same problem here? Do you have a code snippet?

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

4 participants