Explorar el Código

fix: diffs double rendering when CSR'd

Adam hace 4 meses
padre
commit
4dd9f33eba
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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(() => {
   onMount(() => {
-    if (isServer) return
+    if (isServer || !props.preloadedDiff) return
     fileDiffInstance = new FileDiff<T>({
     fileDiffInstance = new FileDiff<T>({
       ...createDefaultOptions(props.diffStyle),
       ...createDefaultOptions(props.diffStyle),
       ...others,
       ...others,