You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,26 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
5
5
and this project adheres to [Semantic Versioning](http://semver.org/).
6
6
7
7
## [Unreleased]
8
+
9
+
### Added
10
+
- Added a `tag` option to change the tag used to render the component (default is `div`)
11
+
8
12
## 0.2.0 - 2017-03-20
13
+
9
14
### Added
10
15
- support for Turbolinks 5, Turbolinks 2.4 and PJAX. Components will be mounted and unmounted when Turbolinks-specific events occur. Also, the integration works with Turbolinks 5 cache.
11
16
- New `WebpackerReact.setup({Component1, Component2, ...})` initialization API. The old API couldn't properly detect the components' names, thus user is required to provide the names in the configuration object's keys.
17
+
12
18
### Removed
13
19
-`WebpackerReact.register(Component)` has been dropped in favor of `WebpackerReact.setup({Component})`
20
+
21
+
14
22
## 0.1.0 - 2017-02-23
23
+
15
24
### Added
16
25
- First released version
17
26
- render React components from views using the `react_component` helper
18
27
- render React components from controllers using `render react_component: 'name'` (#1 by @daninfpj)
Copy file name to clipboardExpand all lines: README.md
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,12 +70,19 @@ Now you can render React components from your views or your controllers.
70
70
71
71
### Rendering from a view
72
72
73
-
Use the `react_component` helper:
73
+
Use the `react_component` helper. The first argument is your component's name, the second one is the `props`:
74
74
75
75
```erb
76
76
<%= react_component('Hello', name: 'React') %>
77
77
```
78
78
79
+
You can pass a `tag` argument to render the React component in another tag than the default `div`. All other arguments will be passed to `content_tag`:
You can also pass any of the usual arguments to `render` in this call: `layout`, `status`, `content_type`, etc.
90
103
91
104
*Note: you need to have [Webpack process your code](https://github.com/rails/webpacker#binstubs) before it is available to the browser, either by manually running `./bin/webpack` or having the `./bin/webpack-watcher` process running.*
0 commit comments