https://github.com/namusyaka/react-sinatra-ujs
https://github.com/namusyaka/react-sinatra-ujs
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/namusyaka/react-sinatra-ujs
- Owner: namusyaka
- Created: 2017-01-09T11:25:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-15T10:25:04.000Z (over 8 years ago)
- Last Synced: 2025-02-27T18:11:58.200Z (3 months ago)
- Size: 4.88 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-sinatra-ujs
[](https://travis-ci.org/namusyaka/react-sinatra-ujs)
`react-sinatra-ujs` mounts components built with webpack.
This is for [react-sinatra](https://github.com/namusyaka/react-sinatra)
## Install
`npm i --save react-sinatra-ujs`
## Usage
### Renders react component in your views
Add your react component in your views by using the `react_component` helper.
```erb
<%= react_component('CommentBox', name: 'namusyaka') %>
```### Mount webpack bundled components
```js
import { mountComponents } from './react-sinatra-ujs';import { CommentBox } from './components/CommentBox';
mountComponents({ CommentBox });
```## License
The package is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).