Skip to content

Commit ca1288f

Browse files
Removed warning when node attribute does not correspond to a prop (#391)
1 parent 1080d8c commit ca1288f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

packages/core/src/api/nodeConversions/nodeConversions.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
BlockSchema,
66
PartialBlock,
77
} from "../../extensions/Blocks/api/blockTypes";
8-
import { defaultProps } from "../../extensions/Blocks/api/defaultProps";
98
import {
109
ColorStyle,
1110
InlineContent,
@@ -394,18 +393,6 @@ export function nodeToBlock<BSchema extends BlockSchema>(
394393
if (attr in propSchema) {
395394
props[attr] = value;
396395
}
397-
// Block ids are stored as node attributes the same way props are, so we
398-
// need to ensure we don't attempt to read block ids as props.
399-
400-
// the second check is for the backgroundColor & textColor props.
401-
// Since we want them to be inherited by child blocks, we can't put them on the blockContent node,
402-
// and instead have to put them on the blockContainer node.
403-
// The blockContainer node is the same for all block types, but some custom blocks might not use backgroundColor & textColor,
404-
// so these 2 props are technically unexpected but we shouldn't log a warning.
405-
// (this is a bit hacky)
406-
else if (attr !== "id" && !(attr in defaultProps)) {
407-
console.warn("Block has an unrecognized attribute: " + attr);
408-
}
409396
}
410397

411398
const blockSpec = blockSchema[blockInfo.contentType.name];

0 commit comments

Comments
 (0)