PropTypes React not working


#1

Hi everyone

I just starting to learn meteor with react, but PropTypes not working for me
in console log i get this message Uncaught TypeError: Cannot read property ‘array’ of undefined

I import import React, { Component, PropTypes } from ‘react’; so anyone can help me and thanks


#2

Try importing PropTypes from a separate package https://www.npmjs.com/package/proptypes, newest versions of React doesn’t include PropTypes, so you have to use it separately.


#3

As Nick mentioned, importing PropType from the react package directly has been deprecated in React 16. Use prop-types npm package instead.

Which version of react are you using?