3 ms·
In this specific case, having useCallback makes the demo code more complex and is unrelated to the actual concept being demo'ed to the reader. It's unwise to ad
by e1g 4y ago
In this specific case, having useCallback makes the demo code more complex and is unrelated to the actual concept being demo'ed to the reader. It's unwise to add unnecessary complexity if it doesn't add clarity.
More generally, adding useCallback is even directionally wrong unless you know _exactly_ why you need it ("for identity" is OK, "for performance" is almost always misguided because the cost of creating a closure is negligible).
- taeric 4y agoWouldn't you want it to be "dependent" on whatever the source of the data is?