We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 68e843f commit 28c559dCopy full SHA for 28c559d
lib/Route.js
@@ -2,20 +2,15 @@
2
3
var React = require('react');
4
5
-//! FIXME how do you typecheck a React Component (not an Element)?
6
-function isComponent(props, propName) {
7
- if (!React.isValidElement(React.createElement(props[propName]))) {
8
- throw new Error("Expected an element type or component.");
9
- }
10
-}
11
-
12
function createClass(name) {
13
return React.createClass({
14
displayName: name,
15
propTypes: {
16
handler: React.PropTypes.oneOfType([
+ // Can be ReactElement or ReactComponent, unfortunately there is no way to typecheck
+ // ReactComponent (that I know of)
17
React.PropTypes.element,
18
- isComponent
+ React.PropTypes.func
19
]),
20
path: name === 'NotFound' ?
21
function(props, propName) {
0 commit comments