beforeAnimationFrame can be overriden to return a
function that runs before each animation frame is triggered.
This is useful for conditionally setting state changes
on every frame. It is idomatic to call
inside of your callback rather than
setState, even though they are
BeforeAnimationFrame get beforeAnimationFrame => null;