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: packages/overmind-website/guides/pro/01_serversiderendering.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
# Server Side Rendering
2
2
3
-
Some projects requires you to render your application on the server. There are different reason to do this, like search engine optimizations, general optimizations and even browser support. What this means for state management is that you want to expose a version of your state on the server and render the components with that state. But that is not all, you also want to **hydrate** the changed state and pass it to the client with the HTML so that it can **rehydrate** and make sure that when the client renders initially, it renders the same UI.
3
+
Some projects require you to render your application on the server. There are different reasons to do this, like search engine optimizations, general optimizations and even browser support. What this means for state management is that you want to expose a version of your state on the server and render the components with that state. But that is not all, you also want to **hydrate** the changed state and pass it to the client with the HTML so that it can **rehydrate** and make sure that when the client renders initially, it renders the same UI.
4
4
5
5
## Preparing the project
6
6
7
-
When doing serverside rendering the configuration of your application will be shared by the client and the server. That means you need to structure your app to make that possible. There is really not much you need to do.
7
+
When doing server-side rendering the configuration of your application will be shared by the client and the server. That means you need to structure your app to make that possible. There is really not much you need to do.
@@ -14,11 +14,11 @@ Here we only export the configuration from the main Overmind file. The instantia
14
14
15
15
## Preparing effects
16
16
17
-
The effects will also be shared with the server. Typically this is not an issue, but you should be careful about creating effects that runs logic when they are defined. You might also consider lazyloading effects so that you avoid loading them on the server at all. You can read more about in the [running side effects guide](/http://localhost:4000/guides/beginner/04_runningsideeffects).
17
+
The effects will also be shared with the server. Typically this is not an issue, but you should be careful about creating effects that run logic when they are defined. You might also consider lazy-loading effects so that you avoid loading them on the server at all. You can read more about them in the [running side effects guide](/http://localhost:4000/guides/beginner/04_runningsideeffects).
18
18
19
19
## Rendering on the server
20
20
21
-
When you render your application on the server you will have to create an instance of Overmind designed for running on the server. On this instance you can change the state and provide it to your components for rendering. When the components have rendered you can **hydrate** the changes and pass them a long to the client so that you can **rehydrate**.
21
+
When you render your application on the server you will have to create an instance of Overmind designed for running on the server. On this instance you can change the state and provide it to your components for rendering. When the components have rendered you can **hydrate** the changes and pass them along to the client so that you can **rehydrate**.
22
22
23
23
```marksy
24
24
h(Notice, null, "Overmind does not hydrate the state, but the mutations you performed. That means it minimizes the payload passed over the wire.")
0 commit comments