webappengine
Version:
A web application platform that can host multiple web apps running with Node.js.
31 lines (24 loc) • 730 B
JavaScript
;
var assign = require('react/lib/Object.assign');
var ReactPropTypes = require('react').PropTypes;
var Route = require('./Route');
var PropTypes = assign({}, ReactPropTypes, {
/**
* Indicates that a prop should be falsy.
*/
falsy: function falsy(props, propName, componentName) {
if (props[propName]) {
return new Error('<' + componentName + '> should not have a "' + propName + '" prop');
}
},
/**
* Indicates that a prop should be a Route object.
*/
route: ReactPropTypes.instanceOf(Route),
/**
* Indicates that a prop should be a Router object.
*/
//router: ReactPropTypes.instanceOf(Router) // TODO
router: ReactPropTypes.func
});
module.exports = PropTypes;