Skip to content

Commit

Permalink
Merge pull request #28 from Team-TenTen/feature/#27/bug-next-theme
Browse files Browse the repository at this point in the history
next-theme 버그 수정
  • Loading branch information
dudwns authored Oct 31, 2023
2 parents 702b611 + 018a034 commit b5b6359
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
'use client'

import { useEffect, useState } from 'react'
import { ThemeProvider } from 'next-themes'

const Providers = ({ children }: { children: React.ReactNode }) => {
const [isMount, setMount] = useState(false)

useEffect(() => {
setMount(true)
}, [])

if (!isMount) {
return null
}

return <ThemeProvider attribute="class">{children}</ThemeProvider>
}

Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export { default as Providers } from './Providers/providers'
export { default as ThemeButton } from './ThemeButton/themeButton'
export { default as Providers } from './Providers/Providers'
export { default as ThemeButton } from './common/ThemeButton/ThemeButton'
export { default as Input } from './common/Input/Input'
export { default as Textarea } from './common/Textarea/Textarea'
export { default as Avatar } from './common/Avatar/Avatar'
export { default as AvatarGroup } from './common/AvatarGroup/AvatarGroup'
export { default as Chip } from './common/Chip/Chip'
export { default as Toggle } from './common/Toggle/Toggle'

0 comments on commit b5b6359

Please sign in to comment.