Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0bd9a67

Browse files
committed
Add warning if is is set and tries to update
1 parent d629f8b commit 0bd9a67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/react-dom-bindings/src/client/ReactDOMComponent.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,14 @@ function setProp(
657657
);
658658
break;
659659
// Properties that should not be allowed on custom elements.
660+
case 'is': {
661+
if (__DEV__ && prevValue != null) {
662+
console.error(
663+
'Cannot update the "is" prop after it has been initialized.',
664+
);
665+
}
666+
break;
667+
}
660668
case 'innerText':
661669
case 'textContent':
662670
if (enableCustomElementPropertySupport) {

0 commit comments

Comments
 (0)