diff --git a/docs/guide/universal.md b/docs/guide/universal.md index 5100a2e9..6ead676d 100644 --- a/docs/guide/universal.md +++ b/docs/guide/universal.md @@ -10,7 +10,7 @@ Because the actual rendering process needs to be deterministic, we will also be ## Component Lifecycle Hooks -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. +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. 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.