forked from remix-run/react-router
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[changed] Deprecate Navigation/State mixins
Fixes remix-run#835 Fixes remix-run#744
- Loading branch information
Showing
11 changed files
with
199 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
var assign = require('react/lib/Object.assign'); | ||
var ReactPropTypes = require('react').PropTypes; | ||
var Route = require('./Route'); | ||
|
||
var PropTypes = assign({ | ||
var PropTypes = assign({}, ReactPropTypes, { | ||
|
||
/** | ||
* Requires that the value of a prop be falsy. | ||
* Indicates that a prop should be falsy. | ||
*/ | ||
falsy(props, propName, componentName) { | ||
if (props[propName]) | ||
return new Error('<' + componentName + '> may not have a "' + propName + '" prop'); | ||
} | ||
return new Error(`<${componentName}> may not have a "${propName}" prop`); | ||
}, | ||
|
||
}, ReactPropTypes); | ||
/** | ||
* 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.