3

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

1

1 Answer 1

3

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'
Sign up to request clarification or add additional context in comments.

3 Comments

Hi! Thanks! Meantime I installed prop-types, but still when I put in import PropTypes from 'prop-types' i.e. in the index.js, it did not help but get warning: 'PropTypes' is defined but never used. What am I doing wrong?
You need to import where you're using. Inside InternalPropTypes.js
Hi! I am still stuck. Applied your suggestion, but I do not know what else I need to do: stackoverflow.com/questions/57671024/how-to-fix-proptypes-issue I do not found any InternalPropTypes.js file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.