Skip to content

Commit

Permalink
✨ 로딩 시 리턴 값 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
oaoong committed Nov 1, 2023
1 parent dd5850a commit d59b56a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 1 addition & 8 deletions src/contexts/MSWWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ const MSWComponent = ({ children }: PropsWithChildren) => {
}
}, [mswReady])

if (!mswReady) {
return (
<>
<div>Mock Worker를 로딩하는 중입니다...</div>
<div>해당 화면이 지속된다면 새로고침 해주세요.</div>
</>
)
}
if (!mswReady) return null

return <>{children}</>
}
Expand Down
6 changes: 3 additions & 3 deletions src/contexts/ThemeProviderContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const ThemeProviderContext = ({ children }: ThemeProviderContextProps) => {
setMounted(true)
}, [])

return (
<ThemeProvider attribute="data-theme">{mounted && children}</ThemeProvider>
)
if (!mounted) return null

return <ThemeProvider attribute="data-theme">{children}</ThemeProvider>
}

export default ThemeProviderContext

0 comments on commit d59b56a

Please sign in to comment.