My learning diary

Create React App environment variables

I worked on React codebases for years. For various reasons, I never had to deal with client-side environment variables.

I first saw environment variable prefixes in Next.

Unfortunately, it took me a while to realise that this concept also applied to create-react-app.

As a result, I spent some time wondering why my environment variables were not replaced at build time. I started to think it was because they were replaced during runtime. I felt silly for believing in everything I read.

My answer is currently under review by the DigitalOcean team.

Relevant posts