瀏覽代碼

fix: diffs double rendering when CSR'd

Adam 1 年之前
父節點
當前提交
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,