@@ -51,6 +51,7 @@ where you will put your components
51
51
// = require react_ujs
52
52
// = require components
53
53
```
54
+ - create a ` server_rendering.js ` manifest file
54
55
55
56
## Usage
56
57
@@ -177,8 +178,8 @@ _(It will also be mounted by the UJS on page load.)_
177
178
178
179
There are some requirements for this to work:
179
180
180
- - ` react-rails ` must load your code. By convention, it uses ` components .js` , which was created
181
- by the install task. This file must include your components _ and_ their dependencies (eg, Underscore.js).
181
+ - ` react-rails ` must load your code. By convention, it uses ` server_rendering .js` , which was created
182
+ by the install task. This file must include React, ReactDOMServer, your components _ and_ their dependencies (eg, Underscore.js).
182
183
- Your components must be accessible in the global scope.
183
184
If you are using ` .js.jsx.coffee ` files then the wrapper function needs to be taken into account:
184
185
@@ -202,7 +203,7 @@ MyApp::Application.configure do
202
203
config.react.server_renderer_timeout ||= 20 # seconds
203
204
config.react.server_renderer = React ::ServerRendering ::SprocketsRenderer
204
205
config.react.server_renderer_options = {
205
- files: [" react-server .js" , " components.js " ], # files to load for prerendering
206
+ files: [" server_rendering .js" ], # files to load for prerendering
206
207
replay_console: true , # if true, console.* will be replayed client-side
207
208
}
208
209
end
0 commit comments