rpflorence/react-nested-router — pull request #67 by bjyoungblood (2014-07-02 16:05:18+00:00)
Title: Add Constrainable mixin

Allows your route handlers to place constraints on the path and/or params they will handle and redirects to another route if the constraints do not match.

Usage:

```javascript
var UserEditHandler = React.createClass({
mixins : [ Constrainable ],

statics : {
redirectTo : '404',
pathConstraints : /^\/user\/123\/(create|edit)$/
},

render : function() { return React.DOM.div(); }
});

var PageEditHandler = React.createClass({
mixins : [Constrainable],
statics : {
redirectTo : '404',
paramConstraints : {
pageId : /^[A-Za-z]+$/,
action : /^\d+$/
},
},
render : function() { return React.DOM.div(); }
});

React.renderComponent(

,
document.body
);
```