diff --git a/readme.md b/readme.md index 56d5989cbc0cd..5fd3893f56b7f 100644 --- a/readme.md +++ b/readme.md @@ -249,6 +249,8 @@ export default class extends React.Component { Notice that to load data when the page loads, we use `getInitialProps` which is an [`async`](https://zeit.co/blog/async-and-await) static method. It can asynchronously fetch anything that resolves to a JavaScript plain `Object`, which populates `props`. +Data returned from `getInitialProps` is serialized when server rendering, similar to a `JSON.stringify`. Make sure the returned object from `getInitialProps` is a plain `Object` and not using `Date`, `Map` or `Set`. + For the initial page load, `getInitialProps` will execute on the server only. `getInitialProps` will only be executed on the client when navigating to a different route via the `Link` component or using the routing APIs. _Note: `getInitialProps` can **not** be used in children components. Only in `pages`._