Compare commits

...

1 Commits

Author SHA1 Message Date
Timur Gibadullin
40dbf3e7df update order 2017-06-02 18:51:19 +03:00
2 changed files with 11 additions and 2 deletions

View File

@ -17,7 +17,7 @@ import {
Platform,
} from 'react-native';
import SortableList from 'react-native-sortable-list';
import {shuffle} from 'lodash';
const window = Dimensions.get('window');
@ -65,6 +65,13 @@ const data = {
};
class Basic extends Component {
state = {
order: Object.keys(data),
}
componentDidMount() {
setInterval(() => this.setState({order: shuffle(this.state.order)}), 3000)
}
render() {
return (
<View style={styles.container}>
@ -73,6 +80,7 @@ class Basic extends Component {
style={styles.list}
contentContainerStyle={styles.contentContainer}
data={data}
order={this.state.order}
renderRow={this._renderRow} />
</View>
);
@ -194,7 +202,7 @@ const styles = StyleSheet.create({
marginTop: 7,
marginBottom: 12,
borderRadius: 4,
...Platform.select({
ios: {

View File

@ -6,6 +6,7 @@
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"lodash": "^4.17.4",
"react": "^15.4.0",
"react-native": "^0.41.2",
"react-native-sortable-list": "../.."