Client functions

createRedirect()#

This utility function is an easy way to make redirects work in static site generation mode.

When it's used, it creates a dummy page that redirects when loaded.

Example#

/pages/index.tsx
export default createRedirect({ to: '/docs/guides' });

Reference#

function createRedirect(options);

optionsDirectoryOptionsrequired

Options for the redirect.


tostringrequired

Where the user gets redirected to when it renders this page.