Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 24, 2021 06:54 pm GMT

Set up .env in react project tips

Found this tips while i'm fetching issue set up .env variable in react project

  • The .env file should be in the root for you application folder. That is one level above your src folder, the same place where you have your package.json
  • The variable should be prefixed with REACT_APP_You need to restart the server to reflect the changes in your code.
  • You should access the variable in your code like thisprocess.env.REACT_APP_SOME_VARIABLE
  • No need to wrap your variable value in single or double quotes.
  • Do not put semicolon ; or comma , at the end of each line.

Source One
Source Two


Original Link: https://dev.to/devded/set-up-env-in-react-project-tips-3i4g

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To