Skip to content

Commit 7b503a3

Browse files
committed
chore: disable eslint warning and update setter name
1 parent 89cf81c commit 7b503a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/theme-provider.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function ThemeProvider({
2626
storageKey = 'vite-ui-theme',
2727
...props
2828
}: ThemeProviderProps) {
29-
const [theme, setThemeState] = useState<Theme>(
29+
const [theme, _setTheme] = useState<Theme>(
3030
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme
3131
)
3232

@@ -56,7 +56,7 @@ export function ThemeProvider({
5656

5757
const setTheme = (theme: Theme) => {
5858
localStorage.setItem(storageKey, theme)
59-
setThemeState(theme)
59+
_setTheme(theme)
6060
}
6161

6262
const value = {
@@ -71,6 +71,7 @@ export function ThemeProvider({
7171
)
7272
}
7373

74+
// eslint-disable-next-line react-refresh/only-export-components
7475
export const useTheme = () => {
7576
const context = useContext(ThemeProviderContext)
7677

0 commit comments

Comments
 (0)