NEW REACT PROJECT – Obligatory To-Do App
The Obligatory To-Do App is a simple React project that I whipped up to test out Vite.
Objectives
The most popular React scaffold, create-react-app, is no longer being maintained, so work needed to find an alternative for spinning up smaller SEO-agnostic React builds. The to-do app is one of the most basic coding projects so I knew I could whip it up fairly quickly.
Development
The workflow for Vite is pretty much the same as create-react-app. You run the create command, it spins up a blank project, then you cd into the project and start the dev server. This is exactly what I was looking for. Vite is supposed to be leaner and more performant than create-react-app and I definitely felt that in the create and build processes. The app itself is pretty straightforward, though I did need a refresher on how to map out components. I intend to be better about keeping up with my React practice this year, and actually getting some React jobs at work should help.
Hurdles
I haven’t dug into how Vite’s caching works yet and I definitely need to because the styles in particular were not always updating. Vite has hot module swapping active by default and I’m not sure if that had something to do with it.
I also need to remember to change the base path of my apps before I run build on them and dump them on the server. I forget every time and spend ten minutes banging my head before it clicks.
Takeaways
Vite is a good decision for small react apps going forward. I need to dig further into the additional features it offers.