The name ‘useRef’ really threw me off. It made me think this hook did one thing, when really it does something else entirely. To stop other people getting all confused like I did, I wrote this post explaining exactly what the useRef hook is, and how to use it. In
Month: February 2020
Why I both hate and love fat arrow functions
When fat arrow functions were first added to JavaScript, I rejoiced. For a language where you often end up writing small functions is place as an argument passed to something, having a concise way to define an anonymous function was really handy. A great example would be the following vs