提交 5a650d74 编写于 作者: A Arunoda Susiripala 提交者: GitHub

Add a note about importing server only modules.

上级 1d126c7d
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册