Преглед изворни кода

fix: diffs double rendering when CSR'd

Adam пре 4 месеци
родитељ
комит
4dd9f33eba
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      packages/ui/src/components/diff.tsx

+ 1 - 1
packages/ui/src/components/diff.tsx

@@ -46,7 +46,7 @@ export function Diff<T>(props: DiffProps<T>) {
   })
 
   onMount(() => {
-    if (isServer) return
+    if (isServer || !props.preloadedDiff) return
     fileDiffInstance = new FileDiff<T>({
       ...createDefaultOptions(props.diffStyle),
       ...others,