btholt / complete-intro-to-react-v6

learn React.js with Brian Holt
https://frontendmasters.com/courses/complete-react-v6/
Other
1.47k stars 214 forks source link

React not defined error #25

Closed rjtbansal closed 3 years ago

rjtbansal commented 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.

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: image

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!

rjtbansal commented 3 years ago

Sorry my bad. I was missing .babelrc file.