Skip to content

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

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

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

Conversation

@johnjenkins
Copy link
Copy Markdown
Contributor

@johnjenkins johnjenkins commented Oct 1, 2025

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
@johnjenkins johnjenkins enabled auto-merge October 1, 2025 12:06
@johnjenkins johnjenkins disabled auto-merge October 1, 2025 12:06
@johnjenkins johnjenkins merged commit 680b12e into main Oct 1, 2025
69 checks passed
@johnjenkins johnjenkins deleted the fix-null-undefined branch October 1, 2025 12:07
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