-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Turn on prerender: true so component server renders, viewable the "view page source" for http://localhost:3000/hello_world 2. React on Rails config needs to set for using the same bundle for client and server rendering. 3. Due to the rails/webpacker importing the HMR: true and inline: true in v5.1, we need to disable those. 4. We can only run this using the foreman start -f Procfile.dev because HMR will not work with SSR until we have a separate bundle for SSR.
- Loading branch information
Showing
3 changed files
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<h1>Hello World</h1> | ||
<%= react_component("HelloWorld", props: @hello_world_props, prerender: false) %> | ||
<%= react_component("HelloWorld", props: @hello_world_props, prerender: true) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters