Take your React beyond the tutorial
React is here to stay. It solves many problems you may not even know existed. These essays are the good stuff I learned over the years.
Learning from tutorials is easy. You follow some steps, learn a smol lesson, and feel like you got dis ๐ช
Then comes the interview, a real world problem, or a question from the boss. Your mind goes blank. Shit, how does this work again ...
Happens to everyone. Building is harder than recognizing and the real world is a mess! Nothing fits in neat little boxes you learned about in tutorials.
That's where my emails come in โ lessons from experience. Building production software :)
Leave your email and get the React email Series - a series of curated essays on building with React. Borne from experience, seasoned with over 12+ years of hands-on practice building the engineering side of growing SaaS companies.
Latest React articles from Swizec
June 2021
A better React 18 startTransition demo
Demoing startTransition is hard. Modern computers are too fast ๐ โ Dan Abramov, a React core team member, helped me fix it up. Here's what I learned
Trying out React 18 Alpha
I read everything about React 18 Alpha, trawled through the work group, and ran some experiments. Here's what you'll wanna know.
A fun security bug with static rendering โ CodeWithSwiz #31
The flash of unlocked content is great fun for any paywall
May 2021
Build privacy-focused blazing fast tweet embeds โ CodeWithSwiz 30
Twitter embeds every tweet on your page as an iframe. Loads 1.2MB of JavaScript, makes 20+ HTTP requests and uses 100+ DOM nodes. ๐ฉ
Twitter embeds without JavaScript, pt1 โ #CodeWithSwiz 29
Continuing our quest for better Lighthouse scores, more reader privacy, and less JavaScript we attacked the next biggest culprit ๐ Twitter.
April 2021
2 quick tips for 250% better Lighthouse scores โ CodeWithSwiz 28
Your site may be fast for users, but Google don't care. Official metrics or bust.
March 2021
Variants โ a quick tip for better React components
Reusable components like to grow boolean props for different situations and complexity soon blows up. Variant props are the perfect solution.
February 2021
A TypeScript trick for reusable hooks
Reusable hooks are all fun and games until TypeScript starts yelling at you about incompatible types.
React Bricks - visual blocks editor for NextJS #CodeWithSwiz 22
Tried a new visual editor for NextJS and CreateReactApp. Got a site up in 20min ๐ค
November 2020
SSR, SSRwR, SSG, CSR, WTFBBQ???
These abbreviations are getting out of hand. It's like a bad interviewer's wet dream.
Gatsby to NextJS pt1, server-side-render or server-side-generate?
Gatsby and NextJS do similar things differently. One is better for websites, the other for webapps. In episode 17 of CodeWithSwiz we explore the biggest difference.
October 2020
Refactoring a useReducer to XState, pt1 โ CodeWithSwiz 11
XState promises to be like useReducer+Context combined and the simplest way to handle complex state in React apps. But can it deliver? On this episode of #CodeWithSwiz, we gave it a shot.
September 2020
Prefetch data with React Query and NextJS โ CodeWithSwiz 8, 9
Prefetching lets you start React apps without loading spinners. Gatsby introduced this concept with `staticQuery`, react-query and NextJS make the pattern easier ๐
Using JavaScript to commit to Github โ CodeWithSwiz 7
Update code with a JavaScript function? Easier than you think ๐
Why NextJS /api routes are fab โ CodeWithSwiz 6
In this episode of CodeWithSwiz, we tried NextJS's support for /api routes โ code running on the backend. In a word โ Wow
How React Query gives you almost everything you thought you needed GraphQL for
GraphQL solves every problem you've ever had talking to APIs on the frontend. Mention a switch to GraphQL to your team and they think it's a joke. Rewrite our entire app? oh you jokester. React Query is the perfect middle ground โค๏ธ
August 2020
Lessons from migrating a 14 year old blog with 1500 posts to Gatsby
After 4 years of putting it off, 1 year of tinkering, a month of work, and $1500 of hired help, my new blog is finally here ๐ Here's what I learned.
June 2020
April 2020
Why you should build a form generator
Lemme guess, every project involves 1 or 2 forms and they're all the friggen same. You got forms coming out the wazoo. Render fields. Connect to state. Add field validation. Detect submit. Add form validation. Send fetch request. Repeat.