Skip to content

Commit 193f08b

Browse files
committed
Revert changes in README introduced by mistake in 0e12182
1 parent bfac685 commit 193f08b

File tree

1 file changed

+37
-1
lines changed

1 file changed

+37
-1
lines changed

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,19 @@ react_component('HelloMessage', {:name => 'John'}, {:id => 'hello', :class => 'f
8787
```
8888

8989

90+
## CoffeeScript
91+
92+
It is possible to use JSX with CoffeeScript. The caveat is that you will still need to include the docblock. Since CoffeeScript doesn't allow `/* */` style comments, we need to do something a little different. We also need to embed JSX inside backticks so CoffeeScript ignores the syntax it doesn't understand. Here's an example:
93+
94+
```coffee
95+
###* @jsx React.DOM ###
96+
97+
Component = React.createClass
98+
render: ->
99+
`<ExampleComponent videos={this.props.videos} />`
100+
```
101+
102+
90103
## Configuring
91104

92105
### Variants
@@ -106,5 +119,28 @@ end
106119
```
107120

108121
### Add-ons
122+
Beginning with React v0.5, there is another type of build. This build ships with some "add-ons" that might be useful - [take a look at the React documentation for details](http://facebook.github.io/react/docs/addons.html). In order to make these available, we've added another configuration (which defaults to `false`).
123+
124+
```ruby
125+
MyApp::Application.configure do
126+
config.react.addons = true
127+
end
128+
```
129+
130+
### Changing react.js and JSXTransformer.js versions
131+
132+
In some cases you may want to have your `react.js` and `JSXTransformer.js` files come from a different release than the one, that is specified in the `react-rails.gemspec`. To achieve that, you have to manually replace them in your app.
133+
134+
#### Instructions
135+
136+
Just put another version of `react.js` or `JSXTransformer.js` under `/vendor/assets/react` directory.
137+
If you need different versions of `react.js` for production and development, then use a subdirectory named
138+
after `config.react.variant`, e.g. you set `config.react.variant = :development` so for this environment
139+
`react.js` is expected to be in `/vendor/assets/react/development`
140+
141+
#### Things to remember
142+
143+
If you replace `JSXTransformer.js` in production environment, you have to restart your rails instance,
144+
because the jsx compiler context is cached.
109145

110-
Beginning with React v0.5, there is another type of build. This build ships with some "add-ons" that might be useful - [take a look at the React documentation for details](http://facebook.github.io/react/docs/getting-started.html)
146+
Name of the `JSXTransformer.js` file *is case-sensitive*.

0 commit comments

Comments
 (0)