@@ -26,7 +26,7 @@ Just getting started with React? Make sure to check out the [Getting Started] (h
26
26
Add ` react-rails ` to your gemfile:
27
27
28
28
``` ruby
29
- gem ' react-rails' , ' ~> 1.7.0 '
29
+ gem ' react-rails'
30
30
```
31
31
32
32
And install:
@@ -90,17 +90,6 @@ See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md
90
90
91
91
After installing ` react-rails ` , restart your server. Now, ` .js.jsx ` files will be transformed in the asset pipeline.
92
92
93
- ` react-rails ` currently ships with two transformers, to convert jsx code -
94
-
95
- * ` BabelTransformer ` using [ Babel] ( http://babeljs.io ) , which is the default transformer.
96
- * ` JSXTransformer ` using ` JSXTransformer.js `
97
-
98
- You can use the deprecated ` JSXTransformer ` by setting it in an application config:
99
-
100
- ``` ruby
101
- config.react.jsx_transformer_class = React ::JSX ::JSXTransformer
102
- ```
103
-
104
93
#### BabelTransformer options
105
94
106
95
You can use babel's [ transformers] ( http://babeljs.io/docs/advanced/transformers/ ) and [ custom plugins] ( http://babeljs.io/docs/advanced/plugins/ ) ,
@@ -115,18 +104,6 @@ config.react.jsx_transform_options = {
115
104
```
116
105
Under the hood, ` react-rails ` uses [ ruby-babel-transpiler] ( https://github.com/babel/ruby-babel-transpiler ) , for transformation.
117
106
118
- #### JSXTransformer options
119
-
120
- You can use JSX ` --harmony ` or ` --strip-types ` options by adding a configuration:
121
-
122
- ``` ruby
123
- config.react.jsx_transform_options = {
124
- harmony: true ,
125
- strip_types: true , # for removing Flow type annotations
126
- asset_path: " path/to/JSXTransformer.js" , # if your JSXTransformer is somewhere else
127
- }
128
- ```
129
-
130
107
### Rendering & mounting
131
108
132
109
` react-rails ` includes a view helper (` react_component ` ) and an unobtrusive JavaScript driver (` react_ujs ` )
@@ -148,6 +125,7 @@ If Turbolinks is present components are mounted on the `page:change` event, and
148
125
__ Turbolinks >= 2.4.0__ is recommended because it exposes better events.
149
126
150
127
In case of __ Ajax calls__ , the UJS mounting can be triggered manually by calling from javascript:
128
+
151
129
``` javascript
152
130
ReactRailsUJS .mountComponents ()
153
131
```
0 commit comments