Skip to content

Commit ffe7697

Browse files
committed
Need to use ClientOnly around random elements
1 parent 49d0320 commit ffe7697

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/webapp/app/components/primitives/charts/ChartLoading.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Paragraph } from "../Paragraph";
44
import { Spinner } from "../Spinner";
55
import { useDateRange } from "./DateRangeContext";
66
import { useMemo } from "react";
7+
import { ClientOnly } from "remix-utils/client-only";
78

89
export function ChartBarLoading() {
910
return (
@@ -121,7 +122,9 @@ function ChartBarLoadingBackground() {
121122
animate={{ opacity: 1 }}
122123
transition={{ duration: 0.5 }}
123124
>
124-
<motion.div
125+
<ClientOnly fallback={<div />}>
126+
{() => (<>
127+
<motion.div
125128
className="flex flex-1 items-end gap-1"
126129
initial={{ opacity: 0 }}
127130
animate={{ opacity: 1 }}
@@ -176,6 +179,9 @@ function ChartBarLoadingBackground() {
176179
</motion.div>
177180
))}
178181
</motion.div>
182+
</>)}
183+
</ClientOnly>
184+
179185
</motion.div>
180186
);
181187
}

0 commit comments

Comments
 (0)