On June 12, 1979, thousands of disco records were destroyed at Chicago’s “Disco Demolition Night”. Within one year, Chicago DJs and producers had reinvented the genre, and house music rose from the ashes of disco.
As hot as it is, React Hooks require a bit of a change in the way you think about React Component Lifecycles, State, and Side Effects and it can be easy to fall into problematic scenarios if you’re not thinking about React Hooks properly. So let’s look a bit at what pitfalls you could come across and how you can change your thinking so you avoid them.
In honour of the upcoming 50th anniversary of the first lunar landing – which launched on July 16th, 1969 – Destin from SmarterEveryDay went to the NASA facility where they keep about 70% of the Moon Rocks that were ever collected (Apollo Missions 11, 12, 14, 15, 16, and 17). The video offers us a truly amazing inside view on how the rocks are stored, manipulated, documented, etc.
Extra kudos to his guide Andrea Mosie, who speaks in such a passionate, open, and honest way about it all. It must be a joy and privilege to work with her.
Deploying one site (from a single source repo) to Netlify ain’t that hard – see my instructions here – but what if your sources are spread out across multiple repos? How do you combine the data without duplicating it into a monorepo?
That’s exactly the problem Spatie was having for their docs.spatie.be: the website holds the documentation for all of their (bigger) open source packages, but the documentation itself is not part of said repo but is stored within each project’s repository.
Here’s a side-by-side comparison recording by @nparashuram of one and the same app . The one of the left is with Hermes, the one on the right without:
To enable Hermes, simply edit your android/app/build.gradle file and set enableHermes to true(requires React Native 0.60.2 or newer):
project.ext.react = [
enableHermes: true // clean and rebuild if changing
One cd android && ./gradlew clean later and you’re good to go 🙂
All numbers are built with 24 round digits. Each digit looks like a small clock, with two hands that can turn. Every time a number changes, for instance when 13:36 turns into 13:37, the hands of all little clocks start moving until the reach such a position that their combined pattern forms the new number.
Yesterday, while at a workshop, React Hooks (intro here) became the subject of discussion between participants. Someone in the audience asked how to easily map the classes+lifecycle way of thinking onto hooks, as she had trouble doing so.
In short, my recommendation was to no longer think in lifecycles but to think in effects, as useEffect was created for exactly this type of thing: when one (state) value changes something else should happen. It also provides you with cleanup methods, to perform stuff one would typically do in componentWillUnmount.
When coming home later that day I was really glad to see that Sebastian had just published a blogpost, along with a practical example, on that very same subject:
React recently introduced a new way to deal with side effects: the useEffect hook. Translating lifecycle methods to useEffect calls can be confusing at first. It’s confusing because we shouldn’t be translating imperative lifecycle methods to declarative useEffect calls in the first place.
Thanks for writing this post Seb, saved me some time from writing it myself 😉