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.