|
|
|
|
|
by BigJono
2017 days ago
|
|
This isn't a "deep dive" in any sense of the word. Call it what it is: 'useRef tutorial'. If I'm opening up something called "deep dive" on a topic I don't know very well then I expect to learn at least something I don't already know from 5 minutes of reading the official docs. Also, why even bother giving an example of useCallback if all the example does is log something to the console? Especially immediately following a section called "Real world use cases". This is how newbs get the mistaken idea that you need shit like useCallback to show and hide an element based on state and you end up with overengineered code everywhere. Examples of library functionality should be of something that you should actually use that functionality for (because it's impossible or impractical to write in other ways). Not just because it makes the docs better, but because it gives you a chance to run into a big red flag when you've implemented something and realise you can't actually find a use case for it. Then again half the people writing docs for libraries in React land don't even use the libraries they're documenting. |
|