Never `useEffect` again or YOU_WILL_BE_FIREDThe study case You Might Not Need an Effect was released, at the very least, a couple of years ago now. It has really helped! Dan did an amazing job and collected a bunch of feedback on Twitter while writing the whole section around `effect`s. Howeve...1LJul 3, 2024 · 3 min readmarcoss.hashnode.dev
`useEffect` doesn't run after the first `render` and whenever its dependencies changeDo you know useEffect? useEffect(() => { console.log(value) }, [value]) This effect runs after the first render and whenever value changes. I bet you've probably learned it that way. This effect runs after the first render... If you've read my a...1JJan 24, 2022 · 3 min readmarcoss.hashnode.dev
Hey, I am React with hooks. There's something apparently not many people tell you about how I work.Down the rabbit hole Give me a component A and I'll: On first render Run A's state lazy initializers. Render A. Update the DOM. Run A's layout effects. Paint the DOM updates from 3. Run A's effects. On subsequent renders (props changed or state cha...1EJan 8, 2022 · 2 min readmarcoss.hashnode.dev
I think I wanted to explain the difference between arrow and normal functions, but I kinda explained this and closures by accidentGlossary A binding is a variable name (this I borrow from the previous glossary). Can be classified into one of two categories: A lexical binding, which can be determined at the lexing step of the compilation. Any variable or function declaration i...Jan 3, 2022 · 9 min readmarcoss.hashnode.dev
Hoisting without mentioning code rearrangementGlossary A binding is a variable name. Variable declarators is the set of keywords that allow declaring variables in JS: var, let and const. What’s this article about? Well... it’s not about hoisting. It’s more about what hoisting isn’t. It assumes...Jan 3, 2022 · 5 min readmarcoss.hashnode.dev