@@ -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
@@ -185,8 +186,8 @@ _(It will also be mounted by the UJS on page load.)_
185
186
186
187
There are some requirements for this to work:
187
188
188
- - ` react-rails ` must load your code. By convention, it uses ` components .js` , which was created
189
- by the install task. This file must include your components _ and_ their dependencies (eg, Underscore.js).
189
+ - ` react-rails ` must load your code. By convention, it uses ` server_rendering .js` , which was created
190
+ by the install task. This file must include React, ReactDOMServer, your components _ and_ their dependencies (eg, Underscore.js).
190
191
- Your components must be accessible in the global scope.
191
192
If you are using ` .js.jsx.coffee ` files then the wrapper function needs to be taken into account:
192
193
@@ -210,7 +211,7 @@ MyApp::Application.configure do
210
211
config.react.server_renderer_timeout ||= 20 # seconds
211
212
config.react.server_renderer = React ::ServerRendering ::SprocketsRenderer
212
213
config.react.server_renderer_options = {
213
- files: [" react-server .js" , " components.js " ], # files to load for prerendering
214
+ files: [" server_rendering .js" ], # files to load for prerendering
214
215
replay_console: true , # if true, console.* will be replayed client-side
215
216
}
216
217
end
0 commit comments