File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ export default function Clock({
99 hasSeconds ?: boolean ;
1010 showSubtext ?: boolean ;
1111} ) {
12+ const [ isClient , setIsClient ] = useState ( false ) ;
13+
14+ useEffect ( ( ) => {
15+ setIsClient ( true ) ;
16+ } , [ ] ) ;
17+
1218 const getTimeParts = ( ) => {
1319 const now = new Date ( ) ;
1420 return {
@@ -36,7 +42,7 @@ export default function Clock({
3642 ) : (
3743 ""
3844 ) }
39- { time . hours }
45+ { isClient ? time . hours : "##" }
4046 </ span >
4147
4248 < span className = "hidden md:inline" > :</ span >
@@ -46,7 +52,7 @@ export default function Clock({
4652 { showSubtext && (
4753 < small className = "-bottom-2.5 absolute text-sm" > minutes</ small >
4854 ) }
49- { time . minutes }
55+ { isClient ? time . minutes : "##" }
5056 </ span >
5157
5258 { hasSeconds ? (
@@ -58,7 +64,7 @@ export default function Clock({
5864 { showSubtext && (
5965 < small className = "-bottom-2.5 absolute text-sm" > seconds</ small >
6066 ) }
61- { time . seconds }
67+ { isClient ? time . seconds : "##" }
6268 </ span >
6369 </ >
6470 ) : (
You can’t perform that action at this time.
0 commit comments