reactjs - React with React-Router: RouteHandler component is completely ignored in the output -


i'm working way through react-router guides (http://rackt.github.io/react-router/), , have nice little router set up. route node in routes variable ignores {application} handler, , straight-up renders dashboard onto page, no control on goes. ideas?

here code i'm using test:

var react = require("react"),     router = require("react-router"),     route = router.route,     defaultroute = router.defaultroute,     routehandler = router.routehandler, // can comment out , nothing breaks      app = {         dashboard: require("./js/components/dashboard.jsx")     },      routes = (         <route path="/" handler={application}>             <defaultroute handler={app.dashboard} />         </route>     ),      // react component ignored, though it's set handler in routes object     application = react.createclass({         render: function() {             return (                 <div>                     <h1>this title never rendered</h1>                      {/* routehandler here ignored. can comment out, , rendering identical! */}                     <routehandler />                 </div>             )         }     });  router.run(routes, router.historylocation, function (routehandler) {     react.render(<routehandler/>, document.getelementbyid("app)); }); 


Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -