From 6e23480b2f7c13ede3742c6fcd44c6519141f13d Mon Sep 17 00:00:00 2001 From: Timur Gibadullin Date: Mon, 14 Aug 2017 15:46:45 +0300 Subject: [PATCH] Update Horizontal example --- examples/Horizontal/index.js | 16 +++++++++++++++- examples/Horizontal/package.json | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/examples/Horizontal/index.js b/examples/Horizontal/index.js index 5d48609..bb4f7f6 100644 --- a/examples/Horizontal/index.js +++ b/examples/Horizontal/index.js @@ -65,6 +65,20 @@ const data = { }; class Horizontal extends Component { + state = {data}; + + componentDidMount() { + setTimeout(() => { + this.setState(({data}) => { + const nextData = {...data}; + + delete nextData[1]; + + return {data: nextData}; + }); + }, 3000); + } + render() { return ( @@ -73,7 +87,7 @@ class Horizontal extends Component { horizontal style={styles.list} contentContainerStyle={styles.contentContainer} - data={data} + data={this.state.data} renderRow={this._renderRow} /> ); diff --git a/examples/Horizontal/package.json b/examples/Horizontal/package.json index 5388670..4176672 100644 --- a/examples/Horizontal/package.json +++ b/examples/Horizontal/package.json @@ -7,7 +7,7 @@ }, "dependencies": { "react": "16.0.0-alpha.12", - "react-native": "0.46.3", - "react-native-sortable-list": "file:../.." + "react-native": "0.47.1", + "react-native-sortable-list": "0.0.16" } } \ No newline at end of file