mirror of
https://github.com/jbranchaud/til
synced 2026-01-05 16:18:01 +00:00
Add Enable ES7 Transforms With react-rails as a javascript til.
This commit is contained in:
@@ -100,6 +100,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
|
||||
- [Character Codes from Keyboard Listeners](javascript/character-codes-from-keyboard-listeners.md)
|
||||
- [Create An Array Containing 1 To N](javascript/create-an-array-containing-1-to-n.md)
|
||||
- [Enable ES7 Transforms With react-rails](javascript/enable-es7-transforms-with-react-rails.md)
|
||||
- [Splat Arguments To A Function](javascript/splat-arguments-to-a-function.md)
|
||||
- [Throttling A Function Call](javascript/throttling-a-function-call.md)
|
||||
- [Transforming ES6 and JSX With Babel 6](javascript/transforming-es6-and-jsx-with-babel-6.md)
|
||||
|
||||
14
javascript/enable-es7-transforms-with-react-rails.md
Normal file
14
javascript/enable-es7-transforms-with-react-rails.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Enable ES7 Transforms With react-rails
|
||||
|
||||
The [`react-rails`]() gem adds JSX and ES6 transforms to the asset pipeline.
|
||||
By using `.js.jsx` and `.es6.jsx` extensions with relevant files, the asset
|
||||
pipeline will know to make the appropriate transformation when compiling
|
||||
application assets. ES7 transforms are not enabled by default, but can be
|
||||
configured. Add the following to the `config/application.js`
|
||||
file to allow ES7's *class properties* syntax:
|
||||
|
||||
```ruby
|
||||
config.react.jsx_transform_options = {
|
||||
optional: ["es7.classProperties"]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user