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
Trying out the new ontimeupdate callback feature, which is great. However, since it fires so quickly, it ends up leading to excessive amounts of re-renders in React when calling state setters from the callback. I was able to verify this by setting 3 different functions to the ontimeupdate callback:
(...) => {}
(...) => setState(...)
(...) => console.log(...)
Function 2 is the only one that causes the entire UI to act very choppy and laggy, and the other ones do not cause any performance issues. Being able to set a custom value for the callback frequency would definitely help anyone who experiences poor performance from using the ontimeupdate feature.
Thank you!
The text was updated successfully, but these errors were encountered:
Interesting. However, if you debounce it to, for example 200 ms, and let's say that the function is called every 27 ms, then debouncing it means it will not run until 200 ms take place between the function calls. That will never happen since it is called every 27 ms. The only way to get that gap is if you pause the player.
Trying out the new
ontimeupdate
callback feature, which is great. However, since it fires so quickly, it ends up leading to excessive amounts of re-renders in React when calling state setters from the callback. I was able to verify this by setting 3 different functions to theontimeupdate
callback:Function 2 is the only one that causes the entire UI to act very choppy and laggy, and the other ones do not cause any performance issues. Being able to set a custom value for the callback frequency would definitely help anyone who experiences poor performance from using the
ontimeupdate
feature.Thank you!
The text was updated successfully, but these errors were encountered: