Skip to content

Commit a86fbde

Browse files
fix(.storybook/preview): disable framer-motion during chromatic
1 parent cd46b7f commit a86fbde

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.storybook/preview.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import { extendBaseTheme } from "@chakra-ui/react"
22
import type { Preview } from "@storybook/react"
3+
import isChromatic from "chromatic/isChromatic"
34

45
import theme from "../src/@chakra-ui/theme"
56

67
import i18n, { baseLocales } from "./i18next"
78

89
import "../src/styles/global.css"
10+
import { MotionGlobalConfig } from "framer-motion"
11+
12+
MotionGlobalConfig.skipAnimations = isChromatic()
913

1014
const extendedTheme = extendBaseTheme(theme)
1115

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"@/public/*": ["./public/*"]
2121
}
2222
},
23-
"include": ["./src/**/*", "next-env.d.ts", "**/*.ts", "**/*.tsx"],
23+
"include": ["./src/**/*", "next-env.d.ts", "**/*.ts", "**/*.tsx", ".storybook/**/*"],
2424
"exclude": ["node_modules", "./public", "./src/intl"]
2525
}

0 commit comments

Comments
 (0)