react-native-pull-to-refresh
react-native-pull-to-refresh copied to clipboard
Cannot read property 'number' of undefined
Hi,
I get the following errors (in Android), after installing your package with npm i react-native-pull-to-refresh --save:
I got this one when onRefresh just logs something with console.log

And this one with a promise

I use it like described in the README:
import PTRView from 'react-native-pull-to-refresh'
refresh () {
return new Promise((resolve) => {
setTimeout(() => { resolve() }, 2000)
})
}
<PTRView onRefresh={this.refresh} >
(...)
</PTRView>
I have same error!
check #22 Go to folder node_modules/react-native-pull-to-refresh/lib change 3 files
PullToRefreshView.ios.js PullToRefreshView.android.js Indicator.js
import React, { PropTypes } from 'react'
to
import React from 'react'
import PropTypes from 'prop-types';
I believe this should be fixed by #24 which was just merged!