blog
.smessina
.com

EXTRACTING CUSTOM REACT HOOKS THE EASY WAY

It's easier than you think

Creating custom React hooks took me a while to “grok.” However, at their core, hooks are just components that don’t render. Here, I’ll show you the quickest, easiest way to extract a custom hook from a complex component.

HANDLING PROMISE ERRORS

.then or .catch?

In a recent Lunch and Learn with the Maxwell engineering team, we noticed two different ways to handle a rejected Promise. One can either include a second argument to the Promise’s .then() function, or add a .catch() function. Curious to learn more, I decided to dig in further.

CHECKING FOR THIRD PARTY COOKIES IN 2021

It's harder than you think

Checking whether third-party cookies are enabled has always been a game of whack-a-mole. The techniques available to us are mostly unreliable. But it is possible to check third-party cookie status with JavaScript in a reliable way across all major browsers, and here’s how.

GOOGLE TAG MANAGER AS A CMS

Because why not?

What happens when you try to shoehorn Google's Tag Manager into use as a CMS? Let's find out.

FROM FRAMEWORKS TO BENCHMARKS

On a winter Saturday morning, I discovered JavaScript’s React framework. I started with a simple tutorial. Before I knew it, 8 hours had gone by, I had created my first React app, and my girlfriend was calling me to tell me I was late for our dinner date.

TEMPLATE LITERALS

From Frameworks To Benchmarks

Ever wish you could compose JavaScript strings without the silly "string" + "string" notation? Want to speed up your DOM updates? Are you sick of the Virtual DOM Loading for every request?

HTML5 TEMPLATES

From Frameworks To Benchmarks

In my previous post, I talked about how to use JavaScript template literals to quickly and cleanly compose dynamic JavaScript string and DOM nodes, but how do we inject those into the DOM without innerHTML calls hijacking the performance gains we got from using template literals?