Nathan Smith
  • Projects
  • About
  • Contact
Migrating to react-static and Netlify

August 1, 2020, 1:47 PM

React

For a long time, my default has been create-react-app and GitHub Pages together to host static sites, this one included. But for static sites, React is almost solely a developer convenience, not a benefit to the end user; if anything, it is a detriment to the end user. React is ...

DevelopmentGithub PagesNetlifyReact
usePrefersDarkTheme: a theming hook for React

July 24, 2020, 9:01 PM

React

Every site needs a dark theme, including this one. Having a dark theme is easy, but if an app or site's theme doesn't follow the system theme it can lead to blinding the user with a white background until they find the toggle. This hook (and some related code to ...

usePrismjs: A prismjs hook for CRA & React

May 20, 2020, 9:14 PM

React

featured

What is it? Prismjs is a powerful little javascript to add syntax highlighting to <pre> and <code> blocks, but it hasn't kept up with a JavaScript framework-using, module-bundling world. There aren't many docs around how to use it with the npm package, and most want you to use a babel ...

Publishing a Dev and Production CRA App to GH Pages

May 20, 2020, 5:57 PM

React

It's pretty easy to set up a CRA app to deploy to multiple GitHub Pages repos. Here's how.

Why functional components are the future of React (but hooks are dangerous)

June 25, 2019, 1:21 AM

React

featured

I was skeptical. Why would I ever write a functional component instead of a class component? Now, I've seen the light, but also the alluring danger of hooks.