From f4c48092e657f48298fce5135e64797148914711 Mon Sep 17 00:00:00 2001 From: Kyle Gach Date: Mon, 14 Nov 2022 10:47:38 -0700 Subject: [PATCH] Fix next@13 `next/link` --- code/frameworks/nextjs/src/preset.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/frameworks/nextjs/src/preset.ts b/code/frameworks/nextjs/src/preset.ts index 2833d9c5752f..0d489fb4a083 100644 --- a/code/frameworks/nextjs/src/preset.ts +++ b/code/frameworks/nextjs/src/preset.ts @@ -68,6 +68,14 @@ export const config: StorybookConfig['previewAnnotations'] = (entry = []) => [ require.resolve('@storybook/nextjs/preview.js'), ]; +export const env = (config: PresetProperty<'env', StorybookConfig>) => { + return { + ...config, + // Can be removed after https://github.com/vercel/next.js/issues/42621 is resolved + __NEXT_NEW_LINK_BEHAVIOR: 'true', + }; +}; + // Not even sb init - automigrate - running dev // You're using a version of Nextjs prior to v10, which is unsupported by this framework.