React Environment Variables in 1 Minute

preview_player
Показать описание

In this video I quickly go over how to create a .env file in your React application! Environment variables are constantly discussed online when using sensitive data such as API keys, so I thought I would make a quick video for anyone who wants to set up environment variables in their React application.
Рекомендации по теме
Комментарии
Автор

You forgot to add that you need to restart the server to see the changes

AbhikShrestha
Автор

Process is undefined.

Below solution for Uncaught ReferenceError: process is not defined:

1. if you are using CRA (create react app), use process.env.

2. if you are using ViteJS, use import.meta.env.

Dark_lord_Dl
Автор

It gets the values as unidefined once printing inside the app file (even after restarting)

EDWRD
Автор

Couldn't have found a better example.
Straight to the point.
Thanks a lot.

YoNoSoyTony
Автор

Dude! You're straight forward with the problem and solution, so nice of you. Thanks much! :)

wzup
Автор

This is what I needed straight to the point. I wish all dev videos are like this 😜

mohamedabdul
Автор

1 minute of my life worth living, thanks man 👍🏽

jordanlyn
Автор

If I want to add data to an enviroment variable after creating, like if I had an env var x that is 3 and I want to do x++, is that ok?

witherblaze
Автор

How can I do:

I can't find a way of using a env variable in another one

FellTheSky
Автор

is there a way to run a command like run ios or run android and set the environment there?

NicolasSilvaVasault
Автор

Thanks a lot for this helpful tutorial!

vudlvnl
Автор

What about other enviroment? How do you seperate them?

Scott
Автор

Will you do some videos on Context Files.. I struggle with what goes in a Constants.js file and why it goes intehre..nice tutorial fast and concise.Thanks

mrcollins
Автор

Creating a 1 minute video was not necessary in this case... Its not a how to cut and paste text in a word doc video.

BleepingWorld
Автор

If you are teaching, why dont you have time? we have enough time to learn

lateefmushtaq