Using Font Awesome with React

Using Font Awesome with React

  • October 22, 2022

Font Awesome is a great resource to use various types of icons in your project including well-known social media icons and a lot more. It can be used with any front-end library. In this post, we are going to be using Font Awesome with React. Set up The first step...

How to write comments in React (JSX)?

How to write comments in React (JSX)?

  • October 15, 2022

I was recently trying to comment out some logic inside my JSX to add context about what a potentially complex logic. I then realized that comments in JSX are weird. So, how to write comments in React (JSX)? You cannot use HTML comments because they are parsed as DOM nodes:...

How to write more readable JavaScript conditionals

How to write more readable JavaScript conditionals

  • October 4, 2022

One of the practices of clean code is to make it more readable. And a fairly common use case in code bases is conditionals. I recently came across a way of writing more readable JavaScript conditionals and thought of sharing it with everyone. Consider the following conditional: The mind takes...

Deep copying in JavaScript using structuredClone

Deep copying in JavaScript using structuredClone

  • August 23, 2022

For as long as anyone can remember, deep copying in JavaScript was not a built-in feature and we had to resort to libraries or workarounds to create a deep copy of a JavaScript value. That has changed now. The platform now offers a built-in function that does deep copying for...

Chrome devtools: Using logpoints for logging messages directly

Chrome devtools: Using logpoints for logging messages directly

  • March 24, 2022

When it comes to debugging JavaScript in Chrome devtools, there are two different camps: the console.log fans and the debugger/breakpoint maximalist. I often switch between the two depending on what problem I am tackling. There is a third option that is kind of in the middle. Logpoints provide us with...