diff --git a/readme.md b/readme.md index c8e00f12..e5b38709 100644 --- a/readme.md +++ b/readme.md @@ -720,6 +720,29 @@ export default ({ url }) => ``` +The router instance should be only used inside the client side of your app though. In order to prevent any error regarding this subject, when rendering the Router on the server side, use the imperatively prefetch method in the `componentDidMount()` lifecycle method. + +```jsx +import React from 'react' +import Router from 'next/router' + +export default class MyLink extends React.Component { + componentDidMount() { + Router.prefetch('/dynamic') + } + + render() { + return ( +
+ ) + } +} +``` + ### Custom server and routing