4 ms·
If they don't want people to just end up depending on this behavior in a stateful way instead they should actually deliberately rely on non-determinism, call th
by dataangel 4y ago
If they don't want people to just end up depending on this behavior in a stateful way instead they should actually deliberately rely on non-determinism, call the functions a small random number of times.
- dymk 4y agoIt's not meant to thwart adversarial cases or situations where programmers are trying to "trick" strict mode. It's a safety net for those who know the "rules" of react, but still might accidentally introduce side effects and want to catch it.
- brundolf 4y agoEven just as a safety-net, there's precedent for this. Golang intentionally randomizes hashmap key iteration order to prevent people from relying on it: https://stackoverflow.com/questions/9619479/go-what-determines-the-iteration-order-for-map-keys#9621526 https://stackoverflow.com/questions/9619479/go-what-determin...