There is a way to make swipe to views? Because I didn't succeed to do it
Here I build a simple table:
export default class InfoTable extends Component {
constructor(props) {
super(props);
this.state = {
tableHead2: ['banana'],
tableData2: [
['kind', this.props.headerInfo.ORDER_TYPE_TXT],
['name', this.props.headerInfo.INITIATOR_NAME],
['place', this.props.headerInfo.FUNC_LOC_TXT],
['equipment', this.props.headerInfo.EQUIPMENT_TXT]]
}
}
Here I use the componentWillReceiveProps
to get the props:
componentWillReceiveProps(nextProps) {
if (nextProps.headerInfo != null) {
this.setState({ tableHead0: [nextProps.headerInfo] })
}
alert(JSON.stringify(nextProps))
}
Here I try to use the Swiper library
(react native)
It doesn't work for me and I don't understand how to fix it:
render() {
const state = this.state;
return (
<Swiper style={styles.wrapper} showsButtons={true}>
<ScrollView>
<View style={styles.container}>
<Table borderStyle={{ borderWidth: 2, borderColor: '#d83dff' }}>
<Row data={state.tableHead2} style={styles.head} textStyle={styles.headText} />
<Rows data={state.tableData2} textStyle={styles.text} />
</Table>
</View>
</ScrollView>
</Swiper>
)
}