4 examples of 'npm proptypes' in JavaScript

Every line of 'npm proptypes' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
17var PropTypes = exports.PropTypes = function PropTypes(React) {
18 return { cols: React.PropTypes.array.isRequired
19 //, rows: React.PropTypes.array.isRequired
20 , data: React.PropTypes.object.isRequired,
21 mapDrill: React.PropTypes.func.isRequired,
22 styles: React.PropTypes.object.isRequired,
23 maxHeight: React.PropTypes.number
24 };
25};
15var setPropTypes = function setPropTypes(propTypes) {
16 return (0, _setStatic2.default)('propTypes', propTypes);
17};
14constructor(props) {
15 super(props);
16 console.log(this.props);
17
18}
30function checkPropTypes(componentName, propTypes, props) {
31 componentName = componentName || 'UnknownComponent';
32
33 for (var propName in propTypes) {
34 if (propTypes.hasOwnProperty(propName)) {
35 var error = propTypes[propName](props, propName, componentName);
36
37 if (error instanceof Error) _warning2['default'](false, error.message);
38 }
39 }
40}

Related snippets