Skip to content

Commit ec71241

Browse files
authored
Merge pull request #924 from node-gs/master
Added documentation for babel transform plugins
2 parents 627c414 + 4ff61bc commit ec71241

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ Components must be accessible from the top level, but they may be namespaced, fo
199199

200200
`react-rails` provides two transformers, `React::JSX::BabelTransformer` (which uses [ruby-babel-transpiler](https://github.com/babel/ruby-babel-transpiler)) and `React::JSX::JSXTransformer` (which uses the deprecated `JSXTransformer.js`).
201201

202+
#### Transform Plugin Options
203+
204+
To supply additional transform plugins to your JSX Transformer, assign them to `config.react.jsx_transform_options`
205+
206+
`react-rails` uses the Babel version of the `babel-source` gem.
207+
208+
For example, to use `babel-plugin-transform-class-properties` :
209+
210+
config.react.jsx_transform_options = {
211+
optional: ['es7.classProperties']
212+
}
213+
202214
### React.js versions
203215

204216
`//= require react` brings `React` into your project.

0 commit comments

Comments
 (0)