Skip to content

Commit

Permalink
some hydrate update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Oct 13, 2023
1 parent 2e1a044 commit 6b8d32b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/myreact-dom/src/client/api/update/hydrateUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ const domPropsHydrate = (fiber: MyReactFiberNode, isSVG: boolean, key: string, v
dom.setAttribute(attrKey, value);
}
} else if (v !== null && v !== undefined) {
if (v === 'false') return;
log(fiber, "warn", `hydrate warning, dom '${attrKey}' attr not match from server. server: ${v}, client: ${value}`);
dom.removeAttribute(attrKey);
}
Expand Down Expand Up @@ -124,7 +125,7 @@ const domInnerHTMLHydrate = (fiber: MyReactFiberNode) => {
const incomingInnerHTML = typedProps.__html as string;

if (existInnerHTML !== incomingInnerHTML) {
log(fiber, "warn", `hydrate error, 'innerHTML' not match from server.`);
// log(fiber, "warn", `hydrate error, 'innerHTML' not match from server.`);

typedDOM.innerHTML = typedProps.__html as string;
}
Expand Down

0 comments on commit 6b8d32b

Please sign in to comment.