Answers for "using .env in CRA"

0

using .env in CRA

Dotenv is somehow already integrated in your CRA

Just create a .env in root
Inside your .env file don't forget to write "REACT_APP_" before your Variable name
i.e: replace ANYTHING_YOU_WANT = ABcdEfghI45545785 by REACT_APP_ANYTHING_YOU_WANT = ABcdEfghI45545785

In whatever file you want you can refere to your .env with 
`${process.env.REACT_APP_ANYTHING_YOU_WANT}`
Posted by: Guest on March-25-2021

Browse Popular Code Answers by Language