-
Notifications
You must be signed in to change notification settings - Fork 49.2k
Open
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: 19.0.0
Steps To Reproduce
- Define a custom element as shown:
class CEWithAttrPropertyClash extends HTMLElement {
test(value) {
this.dispatchEvent(new CustomEvent('test', {detail: value}))
}
connectedCallback() {
this.test(true);
}
}
customElements.define('ce-with-attr-property-clash', CEWithAttrPropertyClash);
- Render
render(<ce-with-attr-property-clash test />);
Link to code example: https://codesandbox.io/p/sandbox/green-resonance-kpwcqg?file=%2Fsrc%2FApp.js%3A10%2C1
The current behavior
this.test is not a function
The expected behavior
React sets attribute as an attribute and does not override function definition
The culprit appears to be this line:
if (name in (node: any)) { |
Which does not check to see if the property is a settable property.
Metadata
Metadata
Assignees
Labels
Status: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug