react-native-pull-up-down-refresh
Version:
A smart pull-down-refresh and pull-up-loadmore react-native listview, for ios, written in pure JS, for android, written in JS and Java.
46 lines (36 loc) • 749 B
JavaScript
import React, {
Component,
} from 'react'
import PropTypes from 'prop-types';
import {
View,
} from 'react-native'
export default class ListItem extends Component {
static propTypes = {
...View.propTypes,
}
constructor(props) {
super(props)
this.state = {
hidden: true,
}
}
render() {
//console.log(`this.state.hidden = ${this.state.hidden}`)
return (
<View {...this.props}>
{!this.state.hidden ? this.props.children : null}
</View>
)
}
show() {
this.setState({
hidden: false,
})
}
hide() {
this.setState({
hidden: true,
})
}
}