react-native-sortable-list icon indicating copy to clipboard operation
react-native-sortable-list copied to clipboard

How to re-render the list?

Open stekolshchykov opened this issue 7 years ago • 1 comments

How to re-render the data? I update the data but it is not output.

Sample code on the line 34.

setInterval(() => {
    let d= this.state.data;
    d.push({
        image: 'https://placekitten.com/200/240',
        text: 'Chloe3',
    })
    this.setState({
        data: d
    })
}, 1500)

stekolshchykov avatar May 10 '18 13:05 stekolshchykov

use es6 concatenating shortcut:

setInterval(() => {
    const newObject = {
        image: 'https://placekitten.com/200/240',
        text: 'Chloe3',
    }
    this.setState({
        data: [...this.state.data, newObject]
    })
}, 1500)

amed avatar Jul 24 '18 10:07 amed