s-ol’s avatars-ol’s Twitter Archive—№ 2,314

          1. …in reply to @laughinghan
            @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];
        1. …in reply to @S0lll0s
          @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...
      1. …in reply to @S0lll0s
        @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.
    1. …in reply to @S0lll0s
      @laughinghan @rsnous completely agree with your conclusion / direction at the end though.
  1. …in reply to @S0lll0s
    @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.