rwr-react_router

react-router integration plugin for react_webpack_rails.

This integration makes it possible to render previously created router in rails view.

Setup

  • Add rwr-react_router to your Gemfile:
 gem 'rwr-react_router'
  • Install rwr-react-router package: $ npm install --save rwr-react-router

Usage

  • Make sure that you have react-router installed.
  • Import RWRReactRouter in your index.js file:

    import RWRReactRouter from 'rwr-react-router';
    
  • Register one of your routers:

    RWRReactRouter.register('MyRouter', MyRouter);
    
  • In chosen view, render your router:

    <%= react_router('MyRouter') %>
    

Contributing

Issues

Found a bug in rwr-react_router? Open an issue on GitHub Issues.

Pull requests

Interested in contributing to rwr-react_router? That's great, and thank you for your interest!

After checking out the repo, run bundle exec rake setup:all to install every environment dependencies.

To get your contributions accepted, make sure:

  • All the tests pass. Run bundle exec rake test:all.
  • Any new code paths you've added are covered by tests.
  • Describe your changes in pull request (what it adds, how to migrate from previous version etc.)

License

The gem is available as open source under the terms of the MIT License.