The React useState
hook is a great way to persist state inside the context of a component in React. This post demonstrates a simple React hook that stores state in the URL querystring, building on top of React Routers useSearchParams
hook.
13 posts tagged with "React"
View All TagsUpgrading to React 18 with TypeScript
The upgrade of the React type definitions to support React 18 involved some significant breaking changes. This post digs into that and examines what the upgrade path looks like.
Structured data, SEO and React
People being able to discover your website when they search is important. This post is about how you can add structured data to a site. Adding structured data will help search engines like Google understand your content, and get it in front of more eyeballs. We'll illustrate this by making a simple React app which incorporates structured data.
React 18 and TypeScript
React 18 alpha has been released; but can we use it with TypeScript? The answer is "yes", but you need to do a couple of things to make that happen. This post will show you what to do.
Throttling data requests with React Hooks
When an application loads data, typically relatively few HTTP requests will be made. For example, if we imagine we're making a student administration application, then a "view" screen might make a single HTTP request to load that student's data before displaying it.
From react-window to react-virtual
The tremendous Tanner Linsley recently released react-virtual
. react-virtual
provides "hooks for virtualizing scrollable elements in React".
Web Workers, comlink, TypeScript and React
JavaScript is famously single threaded. However, if you're developing for the web, you may well know that this is not quite accurate. There are Web Workers
:
Brand New Fonting Awesomeness
Love me some Font Awesome. Absolutely wonderful. However, I came a cropper when following the instructions on using the all new Font Awesome 5 with React. The instructions for standard icons work fine. But if you want to use brand icons then this does not help you out much. There's 2 problems:
Uploading Images to Cloudinary with the Fetch API
I was recently checking out a very good post which explained how to upload images using React Dropzone and SuperAgent to Cloudinary.
Auth0, TypeScript and ASP.NET Core
Most applications I write have some need for authentication and perhaps authorisation too. In fact, most apps most people write fall into that bracket. Here's the thing: Auth done well is a *big* chunk of work. And the minute you start thinking about that you almost invariably lose focus on the thing you actually want to build and ship.
React Component Curry
Everyone loves curry don't they? I don't know about you but I'm going for one on Friday.
ES6 + TypeScript + Babel + React + Flux + Karma: The Secret Recipe
I wrote a while ago about how I was using some different tools in a current project:
Things Done Changed
Some people fear change. Most people actually. I'm not immune to that myself, but not in the key area of technology. Any developer that fears change when it comes to the tools and languages that he / she is using is in the wrong business. Because what you're using to cut code today will not last. The language will evolve, the tools and frameworks that you love will die out and be replaced by new ones that are different and strange. In time, the language you feel you write as a native will fall out of favour, replaced by a new upstart.