You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
How do I force react-infinite to rerender my list, When i deleted one item from the list.
For example :
import React, { Component } from 'react'
import InfiniteList from 'react-infinite';
export default class componentName extends Component {
constructor(){
this.state{
list:[]
}
}
fillList(){
list.push(1);list.push(2)....
}
DeleteItem(){
let x = this.state.list.slice();
x.splice(0,1);
this.setState({list,x});
// so now due to somereason i deleted 1 item , How do now the InfiniteList rerender the list again.
// current behaviour is it doesn't delete that item immediately, But when i scroll back and forth i see //the new list
//Question is how to force inifinite list to re-render it immediately.
}
renderlist(){
return this.state.list.map((item)=>
{item}
);
}
render() {
return (
{this.renderList()} . // when list gets updated, changes are not reflected immediately