Year: 2022
-
Injecting singletons into your React components
Sometimes you’ll need to use the singleton pattern in your applications and there is an easy way to inject these into your React components. This…
-
Where is this (default) prop coming from?
This post is just a quick refresher for the times when you might find yourself mystified as to where a component is getting a certain…
-
Code splitting with lazy and Suspense in React
Knowing how to split your code with Suspense and lazy was discussed in a previous post. In short, you need to dynamically import your component…
-
Suspense without lazy in React
From my previous post, we saw lazy-loaded components being rendered as children of a Suspense component. But what about non-lazy-loaded React elements? Let’s start by…
-
Lazy loading components dynamically with webpack
In previous posts, I’ve shown the basic amount of work to lazy-load a component. In this post, we’ll dive further into a more realistic example…
-
Rendering a list of lazy components in React
We saw in an earlier post how to render lazy-loaded components using Suspense. But what if we have a number of different components that we…
-
Lazy loading and Suspense in React
This is a quick start for using lazy and Suspense in React. We’ll start simply by showing how to use lazy and Suspense. For the…