Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
"Will" makes you wonder if it "will" actually do it.
vicary36262d@C0D4 hmm... that makes the idea way more clearer.
React's render cycle and state update batching, by nature, schedules things to at least 1 tick away. That may confuses those thinking "before" as a synchronous before.
So it should be "before" if it happens in the same tick, otherwise use "will".
A good way to imply the possibility of cancellable events too.
hitko154962d"On will unmount" could always be just "on unmount", since it doesn't affect the component being unmounted, it's just a way to clenup things during that process.
"On before unmount" on the other hand signifies the main proccess didn't start yet (unmounting has been requested and approved by preflight checks, but no action regarding unmounting the component has been taken, and there may still be a way to interrupt the process).
Changing/Changed. It's whatever as long as it's consistent though.
vicary36262dTo put it another way, a cancellable onChange is fired before internal state is changed.