Skip to content

Commit 7e1390f

Browse files
author
Ryan Wez
committed
Updated some files
1 parent 9acabff commit 7e1390f

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
"eslint-config-next": "14.2.5",
4343
"postcss": "^8",
4444
"tailwindcss": "^3.4.1",
45-
"typescript": "^5.4.5"
45+
"typescript": "5.4.5"
4646
}
4747
}

src/components/magicui/animated-theme-toggler.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ export function AnimatedThemeToggler({ className }: Props) {
1515
const toggleTheme = () => {
1616
const newTheme = resolvedTheme === "dark" ? "light" : "dark";
1717

18-
if (!document.startViewTransition) {
18+
// Type assertion for startViewTransition which is experimental
19+
const documentWithTransition = document as Document & {
20+
startViewTransition?: (callback: () => void) => void;
21+
};
22+
23+
if (!documentWithTransition.startViewTransition) {
1924
setTheme(newTheme);
2025
return;
2126
}
2227

23-
document.startViewTransition(() => {
28+
documentWithTransition.startViewTransition(() => {
2429
flushSync(() => {
2530
setTheme(newTheme);
2631
});

0 commit comments

Comments
 (0)