Closed rjtbansal closed 3 years ago
Even though I am using React ver 17.0.1 as in the course I am still required to import React otherwise I get the React not defined error.
React not defined
Here's how my package.json file looks like:
{ "name": "adopt-me", "version": "1.0.0", "description": "Following Front End Masters: Complete Intro to React, v6 course.", "main": "index.js", "scripts": { "dev": "parcel src/index.html", "format": "prettier --write \"src/**/*.{js,jsx}\"", "lint": "eslint \"src/**/*.{js,jsx}\" --quiet" }, "repository": { "type": "git", "url": "git+https://github.com/rjtbansal/adopt-me.git" }, "keywords": [], "author": "", "license": "ISC", "bugs": { "url": "https://github.com/rjtbansal/adopt-me/issues" }, "homepage": "https://github.com/rjtbansal/adopt-me#readme", "devDependencies": { "eslint": "^7.18.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1", "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "parcel": "^1.12.3", "prettier": "^2.3.0" }, "dependencies": { "react": "^17.0.1", "react-dom": "^17.0.1", "react-router-dom": "^5.2.0" }, "browserslist": [ "last 2 chrome versions" ] }
And here's the screenshot I get asking me to import React:
What could be going wrong? Up until now I have followed along and everything works well except if I dont import React.
Let me know if any other info is needed on my end.
Thank you very much in advance!
Sorry my bad. I was missing .babelrc file.
.babelrc
Even though I am using React ver 17.0.1 as in the course I am still required to import React otherwise I get the
React not defined
error.Here's how my package.json file looks like:
And here's the screenshot I get asking me to import React:
What could be going wrong? Up until now I have followed along and everything works well except if I dont import React.
Let me know if any other info is needed on my end.
Thank you very much in advance!