Mounting components built with webpack
npm install react-sinatra-ujsreact-sinatra-ujs mounts components built with webpack.
This is for react-sinatra
npm i --save react-sinatra-ujs
Add your react component in your views by using the react_component helper.
``erb`
<%= react_component('CommentBox', name: 'namusyaka') %>
`js
import { mountComponents } from './react-sinatra-ujs';
import { CommentBox } from './components/CommentBox';
mountComponents({ CommentBox });
``
The package is available as open source under the terms of the MIT License.