.env file
REACT_APP_NODE_ENV=
REACT_APP_GOOGLE_KEY=
index.js
import dotenv from "dotenv";
dotenv.config();
...
const { REACT_APP_NODE_ENV, REACT_APP_GOOGLE_KEY } = process.env;
...
You can use dotenv module with REACT_APP_ prefix..
'Develop > React' 카테고리의 다른 글
typescript + react project via parcel (0) | 2019.03.06 |
---|---|
React Hooks (0) | 2019.03.06 |
[ReactNative] Expo ios simulator said "This version of ..." (0) | 2018.10.23 |
[ReactNative] expo 502 response (0) | 2018.02.14 |
[ReactNative] components and apis (0) | 2018.02.14 |