Skip to content

Commit

Permalink
Add warning if is is set and tries to update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Apr 10, 2023
1 parent d629f8b commit d74688c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,21 @@ function setProp(
);
break;
// Properties that should not be allowed on custom elements.
case 'is': {
if (__DEV__) {
if (prevValue != null) {
console.error(
'Cannot update the "is" prop after it has been initialized.',
);
}
}
// TODO: We shouldn't actually set this attribute, because we've already
// passed it to createElement. We don't also need the attribute.
// However, our tests currently query for it so it's plausible someone
// else does too so it's break.
setValueForAttribute(domElement, 'is', value);
break;
}
case 'innerText':
case 'textContent':
if (enableCustomElementPropertySupport) {
Expand Down

0 comments on commit d74688c

Please sign in to comment.