Skip to content

fix(runtime): stop immediate re-renders for reflected props when null !== undefined - #6404

Merged
johnjenkins merged 5 commits into
mainfrom
fix-null-undefined
Oct 1, 2025
Merged

johnjenkins merged 5 commits into
mainfrom
fix-null-undefined

Conversation

@johnjenkins

@johnjenkins johnjenkins commented Oct 1, 2025 •

Copy link
Copy Markdown
Contributor

What is the current behavior?

When @Prop({ reflect: true }) something is set via a property to undefined
(e.g. document.querySelector('my-thing').something = undefined) this causes the expected re-render but also causes the corresponding attribute to be removed (e.g. cmp.removeAttribute('something')) which in-turn causes the property to be set to null, causing a double re-render which can cause errors

GitHub Issue Number: #6396

What is the new behavior?

Fixes #6396

Now, when an attribute change reflects back to it's property the assessment is null == undefined (instead of null === undefined)

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Testing

Other information

@johnjenkins
johnjenkins requested a review from a team as a code owner October 1, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: TypeError: Cannot read properties of null (reading 'nodeType') is still happening in the latest version

1 participant