react-router 0.1.0

React-router externs for haxe-react

Released 2016-12-22.

To install, run:

haxelib install react-router 0.1.0

See using Haxelib in Haxelib documentation for more information.

Maintainerelsassph
Websitehttps://github.com/elsassph/haxe-react-router
Current version0.1.0
StatisticsInstalled 383 times
LicenseMIT
Tags

README.md

React-router externs for Haxe

Simple externs for react-router 3.0.0+ for use with Haxe react 1.0.0+.

  var history = ReactRouter.browserHistory;

  var app = ReactDOM.render(jsx('
  
    <Router history=$history>
      <Route path="/" component=$PageWrapper>
        <IndexRoute component=$HomeView/>
        <Route path="about" component=$AboutView/>
      </Route>
    </Router>
      
  '), rootElement);

Using haxe-modular it is possible to define asynchronous routes:

  var history = ReactRouter.browserHistory;

  var app = ReactDOM.render(jsx('

    <Router history=$history>
      <Route path="/" component=$PageWrapper>
        <IndexRoute getComponent=${RouteBundle.load(HomeView)}/>
        <Route path="about" getComponent=${RouteBundle.load(AboutView)}/>
      </Route>
    </Router>

  '), rootElement);
````