Skip to content

Commit

Permalink
fix style error
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Oct 9, 2023
1 parent aed409a commit 2e1a044
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/myreact-dom/src/client/api/update/nativeUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const nativeUpdate = (fiber: MyReactFiberNode, renderDispatch: ClientDomD
const typedNewValue = (newValue as Record<string, unknown>) || {};
const typedOldValue = (oldValue as Record<string, unknown>) || {};
const allStyleKeys = getAllKeys(typedOldValue, typedNewValue);
allStyleKeys.forEach((key) => setStyle(fiber, dom, key, typedNewValue[key] as string | number | null | undefined));
const arrayStyleKeys = Array.from(allStyleKeys);
arrayStyleKeys.filter((key) => !Object.is(typedOldValue[key], typedNewValue[key])).forEach((key) => setStyle(fiber, dom, key, typedNewValue[key] as string | number | null | undefined));
} else if (isProperty(key)) {
setAttribute(fiber, dom, key, isSVG, newValue);
}
Expand Down

0 comments on commit 2e1a044

Please sign in to comment.