I installed the prop-types
package by running npm i prop-types --save
and my dependencies are:
"dependencies": {
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
My code:
import React from 'react';
import PropTypes from 'prop-types';
function Question(props) {
return (
<h2 className="question">{props.content}</h2>
);
}
Question.propTypes = {
content: React.PropTypes.string.isRequired
};
export default Question;
I restarted node 5-6 times but still getting this error:
What am I missing here?