This site runs best with JavaScript enabled.

React Hooks: What's going to happen to react context?

Earlier this year, the React team introduced the first official context API. I blogged about that new API and people got sufficiently and reasonably hyped. One common complaint that I knew people were going to have when applying it practically was the fact that the context consumer is a render…

Read →

React Hooks: What's going to happen to render props?

Current Available Translations: Korean About a year ago, I published "How to give rendering control to users with prop getters" . In that post, I show the entire implementation (at the time) of react-toggled which I actually built for the sole purpose of teaching some of the patterns that I used…

Read →

Introducing a new course: Simplify React Apps with React Hooks and Suspense

Learn about the massive improvements coming to function components in React via a fresh new course showing you how to refactor an existing app to these new and upcoming APIs. Ok, before I get into things, can I just say that this course artwork by Maggie Appleton and Maxime Bourgeois is just…

Read →

How Gratitude can make you a better developer

This week in the United States we celebrate Thanksgiving Day . In the US, the celebration was started by Pilgrims who came to America in the 1620s on the Mayflower . They had a pretty rough time getting their settlement started and had help from the Native Americans. Together they celebrated and…

Read →

useEffect vs useLayoutEffect

Both of these can be used to do basically the same thing, but they have slightly different use cases. So here are some rules for you to consider when deciding which React Hook to use. useEffect 99% of the time this is what you want to use. When hooks are stable and if you refactor any of your…

Read →

Testing Implementation Details

Last year when I was using enzyme (like everyone else at the time), I stepped carefully around certain APIs in enzyme. I completely avoided shallow rendering , never used APIs like instance() , state() , or find('ComponentName') . And in code reviews of other people's pull requests I explained…

Read →

Common Testing Mistakes

Mistake Number 0 One of the biggest mistakes you could make would be missing out on my full Testing JS course . (see what I did there?) Mistake Number 1: Testing Implementation Details I harp on this a lot ( read more ). It's because it's a huge problem in testing and leads to tests that don't give…

Read →