Skip to content

Instantly share code, notes, and snippets.

@maka-io
Created February 6, 2018 21:26
Show Gist options
  • Save maka-io/6644b8361f54b74d5cbcbf454ab59b0a to your computer and use it in GitHub Desktop.
Save maka-io/6644b8361f54b74d5cbcbf454ab59b0a to your computer and use it in GitHub Desktop.
Meteor React propTypes checker
if (Meteor.isDevelopment) {
checkProps = (propTypes, props) => {
let matchPropTypes = Object.keys(propTypes).every((a, index) => a === Object.keys(props)[index])
if (!matchPropTypes) {
console.info(`[!] propTypes do not match props`, `[propTypes]`, Object.keys(propTypes), `[props]`, Object.keys(props))
}
};
} else {
checkProps = (propTypes, props) => {};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment