You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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 and precompile it with `config/initializers/react_server_rendering.rb`. (Use `--skip-server-rendering` if you don't want this.)
54
55
55
56
## Usage
56
57
@@ -160,8 +161,8 @@ _(It will also be mounted by the UJS on page load.)_
160
161
161
162
There are some requirements for this to work:
162
163
163
-
-`react-rails` must load your code. By convention, it uses `components.js`, which was created
164
-
by the install task. This file must include your components _and_ their dependencies (eg, Underscore.js).
164
+
-`react-rails` must load your code. By convention, it uses `server_rendering.js`, which was created
165
+
by the install task. This file must include React, ReactDOMServer, your components _and_ their dependencies (eg, Underscore.js).
165
166
- Your components must be accessible in the global scope.
166
167
If you are using `.js.jsx.coffee` files then the wrapper function needs to be taken into account:
167
168
@@ -185,7 +186,7 @@ MyApp::Application.configure do
0 commit comments