The awesome Advent of Code is back for 2022! You can follow along on my github repo or follow on Twitter or Mastodon. Check out my finished Advent of Code solutions here. You can plug in your own puzzle inputs and find your own answers too! This year, I'll be doing my puzzles in React... Continue Reading →
April Fools with these terrible NPM packages
NPM, hosted at npmjs.com, is a repository for storing open-source libraries, frameworks, and packages that anyone can publish to, and anyone can download from. This has great packages in it like ReactJS, Okta, DataDog, Material, Luxon, and many, many more. However, there's also garbage in here. There are some really terrible NPM packages out there... Continue Reading →
Advent of Code 2021 is here!
Time for my second year into Advent of Code! The first year was fun, you can see all of my challenges, answers, and thoughts here: https://davidlozzi.com/tag/advent-of-code/. If you're new to this, let me share what I shared last year: I found this neat little site, big thank you to Eric Wastl, called the Advent of Code. It... Continue Reading →
Keeping React component’s state top of mind
I'm impatient I've done this too many times: // api call to get the contact Luke Skywalker // process a little data return ( <Card> <Card.Title>{person.name}</Card.Title> </Card> ) just to get a lovely Can't read property 'name' of undefined error. Yuck. I fire up the dev console... Network tab, is the API returning data? ✅.... Continue Reading →
Viewing your state with React’s useReducer
In a previous post I shared an approach to enhance reducer actions in your React Context. I've worked through this a few times and found one thing this approach doesn't have that something like Redux does: the logger. Well, there's a separate library for logging called redux-logger. This nifty little piece of middleware writes out... Continue Reading →
Enhancing reducer actions in React Context
State management in ReactJS is uber important, and there is a plethora of content in the wild about how best to do this: from libraries like Redux to using useState in a component. React also has this neat little useReducer hook for using a reducer in your component. This follows the typical reducer pattern of... Continue Reading →
No new features in React v17, but…
It's been an eternity, technology speaking, since we received a major upgrade on ReactJS. The React team has announced v17 Release Candidate: The React 17 release is unusual because it doesn’t add any new developer-facing features.https://reactjs.org/blog/2020/08/10/react-v17-rc.html This release comes with no new features. New upgrades are always shined up with new hot features, right? What... Continue Reading →
Implementing a custom Okta authentication error page in ReactJS
Updated May 5, 2020 to include Okta React library 3.0 The @okta/okta-react library is fantastic. It makes working with Okta authentication really easy in ReactJS. It helps streamline managing the user's authentication including their tokens. You don't even have to create a log in component on your app, users can be redirected to Okta to... Continue Reading →