title: Using react-router without JSX
body: <p>I'm trying to find an example of using react-router through the javascript API but have been unable to find anything so far.</p>
  <p>My goal is to use react-router with reagent and clojurescript.  So if anyone has gotten this working (even with Om), I'd appreciate a push in the right direction.  Otherwise, just a straight javascript example without JSX would be helpful.</p>
  <h3>Edit 1 -- Getting closer to a solution</h3>
  <p>Thanks to @FakeRainBrigand for the help translating the JSX into plain JS.</p>
  <p>Here is the React.js 0.11.2 version (which is what the current release of Reagent uses -- 0.4.3).</p>
  <pre><code>/** @jsx React.DOM */
  Routes({location: &quot;history&quot;},
         Route({name: &quot;app&quot;, path: &quot;/&quot;, handler: App},
               Route({name: &quot;inbox&quot;, handler: Inbox}),
               Route({name: &quot;calendar&quot;, handler: &quot;{Calendar}&quot;})))
  </code></pre>
  <p>Hint: You can perform the JSX-&gt;JS transformation using <code>JSXTransformer.js</code> for your version of React.  Just include it in your page and use your browser's developer console to execute <code>JSXTransformer.transform('/** @jsx React.DOM */&lt;Route location=&quot;history&quot;&gt;...&lt;/Route&gt;').code</code></p>
  <p>Here is the Clojurescript version:</p>
  <pre><code>(ns mytest.core
    (:require [reagent.core :as reagent :refer [atom]])
  
  (defn home []
    [:div [:h1 &quot;Home Component Placeholder&quot;]])
  
  (defn info []
    [:div [:h1 &quot;Info Component Placeholder&quot;]])
  
  (defn build-component [comp]
    (reagent/as-component (if (fn? comp) (comp) comp)))
  
  (defn react-router []
    (js/ReactRouter.Routes #js {:location &quot;history&quot;}
                           (js/ReactRouter.Route #js {:name &quot;app&quot; :path &quot;/&quot; :handler (build-component home)}
                                                 (js/ReactRouter.DefaultRoute #js {:handler (build-component home)})
                                                 (js/ReactRouter.Route #js {:name &quot;about&quot; :path &quot;/about&quot; :handler (build-component info)}))))
  </code></pre>
  <p>Unfortunately, the components Reagent creates by default don't seem to be &quot;standard&quot; React components, in that <code>React.isValidClass(myReagentComponent) === false</code>.  So all that is left is to figure out how to generate the components in the form that passes that test.  I have a <a href="https://stackoverflow.com/questions/26770117/reagent-generate-a-react-component-that-passes-react-isvalidclasscomponent">Stack Overflow question</a> posted for that.</p>