Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
MrWangJustToDo committed Feb 28, 2024
1 parent e2e20ba commit 2ab6808
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/myreact-dom/src/shared/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const validDomProps = (fiber: MyReactFiberNode) => {
fiber,
"warn",
"invalid dom props, expect a string or number but get a object.",
`invalid dom props, expect a string or number but get a object. key: ${key} value: ${props[key]}`
`invalid dom props, expect a string or number but get a object. key: ${key}, value: ${props[key]}`
);
}
if (isStyle(key) && props[key] && typeof props[key] !== "object") {
Expand Down
2 changes: 1 addition & 1 deletion packages/myreact-terminal/src/shared/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const validDomProps = (fiber: MyReactFiberNode) => {

Object.keys(props).forEach((key) => {
if (isProperty(key) && props[key] && typeof props[key] === "object" && props[key] !== null) {
log(fiber, "warn", `invalid element props, expect a string or number but get a object. key: ${key} value: ${props[key]}`);
log(fiber, "warn", `invalid element props, expect a string or number but get a object. key: ${key}, value: ${props[key]}`);
}
if (isStyle(key) && props[key] && typeof props[key] !== "object") {
throw new Error("style or the element props should be a object");
Expand Down

0 comments on commit 2ab6808

Please sign in to comment.