-
@laughinghan @rsnous they shouldn't actually have to *create* very much every frame; afaik the deep inside of a hook is essentially: const key = this.node.id + ':' + (this.node.hookCount++); state[key] ??= initialState; return state[key];
-
@laughinghan @rsnous however the overall functional component patten requires you to *evaluate* a lot of useless code that just does the same thing all over. For example the hook composition that I mentioned in my subthread here needs to be deeply resolved before the "bedrock hooks" are hit...
-
@laughinghan @rsnous ...and the biggest collateral damage IMO is the constant redefinition of event handlers etc, which requires you to sprinkle "useMemo" everywhere which is just silly.
-
@laughinghan @rsnous completely agree with your conclusion / direction at the end though.
-
@laughinghan @rsnous also something interesting: these are all downsides in React, because at runtime the code doesn't change. I came to these concepts from the angle of livecoding, where state AND code constantly change. Reevaluating constantly is then a necessity, and this model fits very nicely.