János
János

Reputation: 35114

TypeError: undefined is not an object in React

I am beginner with React, do not know how to fix this, to get my first app up and running:

TypeError: undefined is not an object (evaluating 'react__WEBPACK_IMPORTED_MODULE_0__["PropTypes"].func')

Following this tutorial: Lynda - Building and Deploying a Full-Stack React Application. Googled the error message. I tried to add this line: import PropTypes from 'prop-types'; Apparently it did not help.

enter image description here


enter image description here

Upvotes: 3

Views: 963

Answers (1)

Dupocas
Dupocas

Reputation: 21357

prop-types is a npm package and does not come in the default installation using create-react-app. It must be install using npm or yarn and imported like this

import PropTypes from 'prop-types'

Upvotes: 3

Related Questions