4 ms·
> outperforms plain React a lot of the time due to optimizations that re-render components only when their inputs change Is this not exactly how React also wor
by sdegutis 7y ago
> outperforms plain React a lot of the time due to optimizations that re-render components only when their inputs change
Is this not exactly how React also works?
- mst 7y agoNot quite, because if react is re-rendering a component it re-renders all its subcomponents as well whether they've changed or not - the DOM diffing stuff means it won't screw with the DOM for stuff that hasn't changed, but it still has to regenerate it to find out.
- sdegutis 7y agoSo reagent skips this by only re rendering a parent of only the parent changed and only re rendering the child of the child’s j out changed? (Presumably using its atoms for props then too and not just state?) This somehow sounds error prone.
- mst 7y agoThat sort of thing is honestly pretty pleasant to write and test in lisp like languages. I wouldn't want to try and write it in javascript, but I'm entirely willing to believe that clojure/cljs got it right.
- sdegutis 7y agoI don't see what s-expressions have to do with this concept. It should be just as doable and nice in JS...