GSGlenn Stovallinpeanutbutterjavascript.hashnode.dev·Jul 13, 2022 · 2 min readEvery way to immutably update an objectThe less you mutate your data, the better, and the easier it will be to reason about your code. The concept of not changing values is known as immutability. Handling immutability with objects can be tricky. Here are some examples for handling various...00
GSGlenn Stovallinpeanutbutterjavascript.hashnode.dev·Jul 13, 2022 · 3 min readHow to build an indeterminate checkbox in ReactFun fact: Did you know that HTML checkboxes have three built-in states, not just two? In addition to the checked state, there is also an indeterminate state. You can’t set a checkbox to indeterminate with HTML, only with JavaScript. Here’s what they ...00
GSGlenn Stovallinpeanutbutterjavascript.hashnode.dev·Jul 13, 2022 · 6 min read4 ways to manage component stateIn earlier versions of React, you were required to use a class component instead of a function component if a component needed to manage state. If you started with a function component that later needed to use state, you would have to rewrite the fun...00
GSGlenn Stovallinpeanutbutterjavascript.hashnode.dev·Jul 13, 2022 · 2 min readA less painful way to tackle package dependency Yak ShavesEver have trouble updating your JavaScript dependencies? Try a LIFO approach: Figure out what is the dependency that is the lowest on the dependency tree that requires an update, and start there. When I say lower on the dependency tree, I mean closer...00
GSGlenn Stovallinpeanutbutterjavascript.hashnode.dev·Mar 25, 2022 · 3 min readWhen you should (and shouldn't) use ReduxRedux is a powerful library, but it is also opinionated and adds boilerplate code to your application. In exchange, you get power state management and debugging tools like time travel. How can you tell if the trade-offs will be worth it for your proj...01J