I faced a similar problem. My solution was to set a timeout before adding new value to the state and clear it before.

Probably the problem is because setState() is usually asynchronous, which means that at the time you wanna see changes in the state, it's not updated yet.

const watchNewVideo = (video) => {
setTimeout(() => {
}, 10);


Related Query

More Query from same tag