@0xca0a It’s not broken, it’s how Fast Refresh works. All memo/effects have to re-run — without that, old code would get “stuck” in them 🙂 This is what lets you adjust values passed to custom Hooks without their authors implementing anything special. reactnative.dev/docs/fast-refr… Hooks with dependencies—such as useEffect, useMemo, and us
@0xca0a This is different from remounting because remounting destroys local state below and recreates the DOM nodes. Not happening here.
@0xca0a This does mean that patterns that rely on useEffect meaning strictly “mount” and “unmount” won’t work well with Fast Refresh. But they cause other problems too (e.g. hard to introduce a new dependency when needed) so Fast Refresh pushes you to write better code.

• • •

Missing some Tweet in this thread? You can try to force a refresh

Keep Current with Dan Abramov

Dan Abramov Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!


Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @dan_abramov

10 Jan
Can someone confirm that I understand the intuition behind the principle of induction correctly?
Weak induction: if I knock a domino piece and show that knocking one piece knocks the next piece, I’ve shown that all domino pieces have been knocked.
Strong induction: if I show that knocking all pieces between A and B always knocks B, I’ve shown that all pieces after A have been knocked.
Read 4 tweets
30 Dec 20
Where is the monument to the person who invented a pickle
Early culinary history must have been fascinating. All the heroes who got sick or died eating the wrong stuff just so we can discover the 1% of food that actually gets better after burning, freezing, crushing, or leaving it open for a week
O Brave souls who ate a thousand poisonous herbs to find the one that goes well with meat, you may be gone but not forgotten
Read 5 tweets
29 Dec 20
Funny how people don’t really know their impact on others. Like some song may be hugely personally meaningful to me but it’s just a few random streams for the artist. Or I’ve learned something from a random old comment but that commenter would say it’s silly or uninformed today.
And would they care? I don’t know. Like if I told that to some artist they’d probably feel icky and awkward. They just made a thing and they know it’s good, but they’re not responsible for my feelings. That thing has its own life now.
I think the part I tend to get wrong is projecting the awesomeness onto the person when it’s really about the work of art they’ve fished out, and my interpreting it. Stanning them might be awkward but stanning the work is not because clearly we both liked it a lot.
Read 4 tweets
27 Dec 20
I love how people watching me talk and mentioning my age or calling me a millennial straight up assume I wasn’t around when PHP, ASP .NET, or even XSLT were hype. I’m not deeply familiar with them because I mostly did desktop but I started early so I’ve seen a few things. 🙂
Here’s a challenge. When I want to tweet “X is just like Y back in the olden days” I try adding “but...” and figure out what the difference is. If I thought of a past analogy after one minute of thinking, clearly I’m not the first one to think this, and there might be more to it.
It’s easy to see the past references. They stand out, and there’s a limited number of variables to play with in the design. Some things will repeat. It’s harder to notice the new twist. Which can turn a past weakness into strength or solve a limitation.
Read 6 tweets
18 Sep 20
I was thinking about the sentiment you might see when something new is introduced. “Oh no, another thing to learn, why can’t we stop.”

And while I get the frustration I also wonder. Are there people who genuinely expect that they’ll be able to stop learning in this field?
Like, another JS library. Of course there is. Why wouldn’t there be? I would be concerned if there are no new ideas being tried. What did you expect, that there’s a limited number of things to learn and then you’re done for the rest of your career? That’s not how it works.
I think maybe the sentiment here may actually be directed against inexperienced project leads. Who might be overly tempted to jump between solutions and impose new things on their team. That can be frustrating.
Read 5 tweets
18 Sep 20
Crash 4 time squeeze gameplay is really addictive. Digging it. Like the visual style too. My only gripe is the shadow — I get that it helps placement but it almost feels like a cop-out so that the games can’t blame the collision system. “You saw where you landed!”
I so DON’T miss the “four lives and then you have to restart” mechanic. Glad they cut it.
So many subtle touches. Keeping some mechanics like you can smash a box with tnt above it. But doing away with annoying things like accidentally spinning wumpas.
Read 5 tweets

Did Thread Reader help you today?

Support us! We are indie developers!

This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!