1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Add a note about importing server only modules.

This commit is contained in:
Arunoda Susiripala 2017-06-29 22:21:23 +05:30 committed by GitHub
parent 1d126c7d14
commit 5a650d74df

View file

@ -235,6 +235,11 @@ For the initial page load, `getInitialProps` will execute on the server only. `g
_Note: `getInitialProps` can **not** be used in children components. Only in `pages`._
<br/>
> If you are using some server only modules inside `getInitialProps`, make sure to [import them properly](https://arunoda.me/blog/ssr-and-server-only-modules).
> Otherwise, it'll slow down your app.
<br/>
You can also define the `getInitialProps` lifecycle method for stateless components:
```jsx