From 42f380baebfb031c9b42342f78ac4d72c3e7fdb9 Mon Sep 17 00:00:00 2001 From: shinya Date: Thu, 26 Jun 2025 21:14:17 +0800 Subject: [PATCH] fix: type error --- src/components/ThemeToggle.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ThemeToggle.tsx b/src/components/ThemeToggle.tsx index 6e0e7eb..41f0f75 100644 --- a/src/components/ThemeToggle.tsx +++ b/src/components/ThemeToggle.tsx @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ + 'use client'; import { Moon, Sun } from 'lucide-react'; @@ -19,12 +21,12 @@ export function ThemeToggle() { const toggleTheme = () => { // 检查浏览器是否支持 View Transitions API - if (!document.startViewTransition) { + if (!(document as any).startViewTransition) { setTheme(theme === 'dark' ? 'light' : 'dark'); return; } - document.startViewTransition(() => { + (document as any).startViewTransition(() => { setTheme(theme === 'dark' ? 'light' : 'dark'); }); };