jacobp100 / hooks-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

then vs, now comparison

brucou opened this issue · comments

Hi!! nice that you are willing to share your experiments. I was just wondering if you could provide the original code, so the it is much simpler assertion could be evaluated independently. Theoretically hooks are just a syntax replacement, and moving the boilerplate into React core instead of your code. Whether it is simpler is another debate. That is shorter seems obvious.

Sorry, it's proprietary code :(

Just imagine two components with very coupled logic, and each being over 1k lines 😛

It was hard to decouple stuff because all your event handlers pretty much had to be in the component, and all the hooking up of them also had to be there. And extracting out the logic of the event handlers wasn't an option either, as you would have quite a lot of one line handlers, so at best, it's death by papercuts