First React Component
This is the first React component that I wrote for this site. As such, it's delightfully simple; a
Hello, world.
to adding a React component to this
Flask website. Below is a form where
you can add a name, click Add Hello
and see a bit of text appear. Magic! You can also
clear all of
the names you've added so far using the Clear Hello(s)
button.
This component, while simple, required quite a bit. First, just like making an apple pie from
scratch, if you wish to make a React component, you must first invent the universe. In this
context, this required creating a package.json
to manage my new JavaScript dependencies
(until now, I was only using Poetry for dependency
management, but Poetry is a Python dependency
manager which won't get me very far in this new JavaScript world, so NPM had to enter the fray).
Next, I had to integrate Webpack and
Bable to help transpile and build my React code to JavaScript that
the browser could render.
Finally, I had to update my Dockerfile to install and bundle all of these new assets so that they
could be deployed to Google Cloud Run. Whew!