Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fb1ac8c

Browse files
authoredApr 28, 2019
Add serverPrefetch to list of lifecycle hooks called during SSR
1 parent eb1c9db commit fb1ac8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎docs/guide/universal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Because the actual rendering process needs to be deterministic, we will also be
1010

1111
## Component Lifecycle Hooks
1212

13-
Since there are no dynamic updates, of all the lifecycle hooks, only `beforeCreate` and `created` will be called during SSR. This means any code inside other lifecycle hooks such as `beforeMount` or `mounted` will only be executed on the client.
13+
Since there are no dynamic updates, of all the lifecycle hooks, only `beforeCreate`, `created` and `serverPrefetch` will be called during SSR. This means any code inside other lifecycle hooks such as `beforeMount` or `mounted` will only be executed on the client.
1414

1515
Another thing to note is that you should avoid code that produces global side effects in `beforeCreate` and `created`, for example setting up timers with `setInterval`. In client-side only code we may setup a timer and then tear it down in `beforeDestroy` or `destroyed`. However, because the destroy hooks will not be called during SSR, the timers will stay around forever. To avoid this, move your side-effect code into `beforeMount` or `mounted` instead.
1616

0 commit comments

Comments
 (0)
Please sign in to comment.