42 ms·
To add insult to injury it's fairly easy to use hooks wrong - and used wrong they are, which suggests that their learning curve is not as friendly as proponents
by Tade0 7y ago
To add insult to injury it's fairly easy to use hooks wrong - and used wrong they are, which suggests that their learning curve is not as friendly as proponents of this pattern would wish.
- nezygis 7y agoCould you share some examples of hooks used wrongly in code?
- Tade0 7y agouseCallback used as something else than a provider of callback functions, e.g. for rendering. Example: const renderItem = useCallback(() => <Item />, []); And then: return renderItem(); What should have been used here is useMemo.