Blog

Hi! I'm Mae Capozzi. Welcome to my corner of the internet. I'm a Brooklyn-based software engineer interested in design systems, component libraries, and the JAMStack.

When leveraging the npm ecosystem, you inevitably add dependencies to your codebase. That’s great –– we’re lucky to have a robust open-source culture. Strangers have solved many problems you might run into! But there’s a catch…all the libraries you depend on are bound to evolve, which means you need…

In this post, I’m using vim. But you can use a different editor if you want! You’ll need to figure out how to use your editor as your machine’s default git commit/diff tool. You can find instructions for configuring this with VS Code here. Developers have different opinions about whether to rebase…

I’m building a Gatsby app that consumes data from a GraphQL service with the help of apollo-client and TypeScript. Because Gatsby creates static assets at build time, I needed a data-fetching tool that would work on the client-side and the server-side. apollo-client recommends using node-fetch for…

This post is part of an ongoing series about the problems you’ll need to solve before you start building a component library. Stay tuned for more topics! Versioning is one of the most challenging aspects to building and maintaining any library. It’s also one of the most crucial. If you want people…

useBreakpoints: a hook

February 15, 2019

I built my first hook a few months ago, and figured I should get it up on the blog. It’s a replacement for a Higher Order Component that exists in a codebase I’m working on. That HoC passes a breakpoint to a component that dictates how the component renders across different breakpoints. If you want…

When you’re configuring a monorepo with lerna, you might consider writing your build scripts like this: It makes sense, initially! You’re probably thinking, why wouldn’t I want to build all my scripts concurrently, rather than running each build one-by-one? The above build script actually works…

How to use React.Lazy

October 29, 2018

React 16.6.0 introduced , which allows you to code-split using the new Suspense API. Siddharth Kshetrapal came out with a great video showing how this works in 60 seconds. I’d recommend watching it –– it’s really well-done. I’ve built a Github clone based off of Siddharth’s example. Hopefully this…

The React ecosystem offers multiple ways to pass data and manage state in a client-side application. A developer might choose between prop drilling, redux, MobX, and the new Context API introduced in React 16 depending on the size and complexity of the application they are developing. A developer…

Modular frontends are all the rage these days, especially with the rise of React.js. Large companies have begun open-sourcing their frameworks,. Google has Material UI, Shopify has Polaris, and Palantir has Blueprint. You, (or your boss), might be thinking that it’s time for your company to get in…

Developers tend to have opinions on style. If you’ve been in the industry for more than 15 minutes, you’ve at least heard about the arguments over spaces or tabs. And don’t even get me started on whether JavaScript needs semi-colons or not. That’s where automatic code formatting comes in. Sure, when…

React 16 has better error handling than previous React versions. If an error occurred inside of a component, it would “corrupt React’s internal state.” Then, we would end up with “cryptic” error messages, or just a blank screen. React lacked a way to expressively and eloquently handle these errors…

I built the same program 4 different ways. I started with callbacks, moved on to Promises, used generators, and finished up with async/await. The program: Makes a request to Github’s users endpoint Pulls back my Github profile Logs the response Here’s what I came up with. Callbacks I struggled to…

You can find part 2 here, and part 3 here. This series will walk you through how to make HTTP requests to the Github REST API in React.js. I’ve chosen the Github API because it is well-organized and doesn’t require us to do any sort of authentication. Part 1 will focus on setting up a React…

If you haven’t completed part 1 of this tutorial, do so before starting part 2. Now that we’ve set up our project using create-react-app, we can start writing some code. Open your project into your editor of choice, and let’s start removing some of the boilerplate that create-react-app adds for you…

If you haven’t completed part 1 and part 2 of this tutorial, please do so before starting part 3. Now we’re getting to the good part! So far, we’ve set up a new React application using , and we’ve wired up our component to log ‘Success!’ when we click the button. Now, we need to make the actual HTTP…

Hoisting remains one of the quirkier aspects of JavaScript. When a developer declares a variable in JavaScript, that variable *behaves *as if it’s been lifted to the top of it’s available scope. This article isn’t going to concern itself with what actually happens behind the scenes to cause this…

Eric Elliot, in his Medium article Master the JavaScript Interview: What is a Closure?, explains that when he interviews candidates for JavaScript jobs, he always asks questions about closures. He writes: “I don’t care if a candidate knows the word “closure” or the technical definition. I want to…

Before you begin, make sure you have node and npm installed. Use a node version higher than 6. Also, note that all terminal commands are for Mac. Please use the equivalent commands for your OS. The repository for this tutorial lives here The other day I was setting up a D3.js project when I ran into…