Have you ever wondered about why setState takes two callbacks? The first one is for making changes in the React world. The second one is for making changes outside the React world. Subtle. I think this split will start to matter a lot more (even if you use MobX etc).
-
-
That's not what that means. The just JS part is not that you can just mutate whatever you want. It is that you can use JS to express your render function. Global side-effects and mutable state has always been difficult to manage. (E.g. scope tracking in Babel.)
-
The same thing applies to async/await for example. You can have side-effects but you better be careful that you don't just do whatever. This is probably a bad pattern: function foo() { var x = {}; await Promise.all(bar(x), bar(x)); return x; }
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
he/him 