react-minimal-router
Bare router for React components, using query string as props.
http://mysite.com/?component=Father&eyes=blue&mood=happy
This route would render the Father component (see getComponentClass
option),
using the following props:
eyes: 'blue' mood: 'happy'
Options
var Router = Router; var myRouter = // These props will be sent to all components loaded, and will be overridden // by the ones in the URL query string defaultProps: fries: true // This is how the router maps component names to corresponding classes { return ; } // Tell React where to render in the DOM container: document // Called whenever the route changes (also initially), receiving the parsed // params as the first argument { // E.g. Use the params to set a custom document.title };
The router always sends a reference to itself to the rendered component through
the router
prop.
Changing the route
var stringifyParams = uristringifyParams; //... { return <div ="serious-component"> <a = => Click me por favor </a> </div>;};