Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-rails-mounter

xinranxiao19MIT1.0.1

Mounting react components in Rails off of the asset pipeline

react, mounting, react-rails, webpack

readme

react-rails-mounter

This repo builds off of react_ujs.js in react-rails.

For those who are migrating off of the asset pipeline (into Webpack for example), it's often hard to manage mounting the React component tags generated by the react-rails gem. A few limitations/problems with the react_ujs.js driver:

  1. You can only load the driver via the asset pipeline.
  2. The driver expects your components to be exposed in the global scope.
  3. The driver may load and execute before your components are loaded.

This small library offers a way for you to mount your components completely off of the asset pipeline, at a time when the component-specific JS is loaded.