We refactor APP_ID
and CLIENT_URL
out of the index.js
file to prepare our application to share these variables across multiple files.
Instructor: [0:00] Let's go back to our app. I'm going to open up a new terminal and going to make a directory called utils. Then I'm going to touch a file called src/utils/auth.js. I'll switch to it. We'll need to export const appId.
[0:33] This is the same appId we have in here. I'm just moving these variables over to a utils file. Then we'll take this. We'll go export const, and then we'll interpolate this and go appId. Inside of our index.js file, we will import clientURL from '.utils/auth'. Everything works fine. We're just getting that same error.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!