I've changed the state here by dropping a object inside players
. but it seems the state is not changed instantly? Is it a feature or a bug I made somewhere else?
console.log("Before(length):"+this.state.players.length);
players=players.filter(player => player.id !== id2);}
this.setState({players});
console.log("After(length):"+this.state.players.length);
the result is
Before(length):6
After(length):6
which should be 5 afterwards?