facebook / prop-types

Runtime type checking for React props and similar objects
MIT License
4.48k stars 356 forks source link

React prop-types not showing in the console #271

Closed whittlem closed 5 years ago

whittlem commented 5 years ago

"react": "^16.8.4" "react-dom": "^16.8.4" "prop-types": "^15.7.2" "eslint-plugin-react": "^7.12.4"

prop-type warnings are not working in the web browser console. If the prop-type validation is removed and you run "eslint " it says the prop-types need to be validated. If you add the prop-type validation in then eslint is happy but you don't see any warnings if you deliberately create one.

  1. Web browser console logging is verbose
  2. No warning is shown if prop-types are not passed to the component
  3. No warning is shown if an invalid prop-type for a prop is passed to a component
  4. Confirmed the prop type config is as per the examples including checking it is propTypes instead of PropTypes in the definition
  5. React seems to be importing PropTypes from prop-types without an error
  6. Checked we are using the latest version of prop-types
  7. In React Native it seems to be fine, but in React it is not
ljharb commented 5 years ago

I’m not clear on the problem here. eslint warnings are unrelated to whether propType validations are performed by react.

Please share your component code?

whittlem commented 5 years ago

It's still not working but it is not causing a problem so closing this issue.