Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

Commit

Permalink
ignore 'search=true' case in favor of easier code
Browse files Browse the repository at this point in the history
  • Loading branch information
rutsky committed Sep 4, 2015
1 parent 6ec7cf8 commit cd3c967
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions json-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,10 @@ module.exports = React.createClass({
React.PropTypes.array.isRequired,
]),
// For now it expects a factory function, not element.
search: function(props, propName, componentName) {
componentName = componentName || '<<ANONYMOUS>>';
var propValue = props[propName];
if (typeof propValue === 'boolean') {
if (propValue) {
throw Error(
'Invalid prop `' + propName + '` with value ' +
'`' + propValue + '` ' +
'supplied to `' + componentName + '`, ' +
'expected `function` or `false`.');
}
} else if (typeof propValue !== 'function') {
throw Error(
'Invalid prop `' + propName + '` of type ' +
'`' + typeof propValue + '` ' +
'supplied to `' + componentName + '`, ' +
'expected `function` or `false`.');
}
},
search: React.PropTypes.oneOfType([
React.PropTypes.func,
React.PropTypes.bool,
]),
onClick: React.PropTypes.func,
validateQuery: React.PropTypes.func,
isExpanded: React.PropTypes.func,
Expand Down

0 comments on commit cd3c967

Please sign in to comment.