I think a new React best practice will become: handleClick() { this.setState({ active: true }); requestIdleCallback(this.props.onAction); }
Conversation
We do that in UIKit; it has lead to some pretty surprising results since other things may be calling requestIdleCallback…
1
3
Gotta be very careful about what you assume about the world when that callback is invoked vs. when the touch event arrived…
1
2
Yea, we're looking to do something slightly different than just raw rIC. handleAction(props, state) { ... return newState; }
2
3
Replying to
Yeah, absolutely. I think this can be great if there’s holistic control over timing.
Replying to
The algorithm for `props` is difficult to ensure that it'll be what the props would've been without batching.
1
1
...and for the `props` case it rarely ever even matters in practice. However it can and then it is confusing.
2

