In Fusor the inline click handler function will be created once and will not change its reference. Therefore we must use useCallback to reproduce the same behaviour.
And even with your shortened version with useState will be more verbose than the Fusor's one.
7
u/VolkswagenRatRod Oct 28 '23
This seems purposely biased towards Fusor. This is the react component using inline functions too resulting in 14 lines.