Skip to content

fix when update comment node occur error#406

Merged
yisar merged 1 commit intofrejs:masterfrom
RosApr:fix-update-dom-bug
Sep 24, 2025
Merged

fix when update comment node occur error#406
yisar merged 1 commit intofrejs:masterfrom
RosApr:fix-update-dom-bug

Conversation

@RosApr
Copy link
Copy Markdown
Contributor

@RosApr RosApr commented Sep 24, 2025

when click button will flush an update task
update task will update A component which has a comment node
when oldProps {count:true} newProps {count:false}
the jointInter function will throw a error because comment node doesn't have removeAttribute method
by the way: another method is comment node no need to update with prop, just update is text node

function App() {
  const [count, setCount] = useState(false)
  return <A count={count} setCount={setCount} />
}
function A({count, setCount}) {
  return <div>
    <button onClick={()=> setCount(prev => !prev)}>toggle</button>
    <div>{count + ''}</div>
  </div>
}

@RosApr RosApr changed the title fix when update comment node occur bug fix when update comment node occur error Sep 24, 2025
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 24, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.32%. Comparing base (8bf6caf) to head (5fe4b1f).
⚠️ Report is 18 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #406   +/-   ##
=======================================
  Coverage   94.32%   94.32%           
=======================================
  Files           8        8           
  Lines         881      881           
  Branches      199      199           
=======================================
  Hits          831      831           
  Misses         50       50           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yisar yisar merged commit 72c3288 into frejs:master Sep 24, 2025
1 check passed
@yisar
Copy link
Copy Markdown
Member

yisar commented Sep 24, 2025

LGTM

@RosApr
Copy link
Copy Markdown
Contributor Author

RosApr commented Sep 24, 2025

LGTM

LHLWDG

@RosApr RosApr deleted the fix-update-dom-bug branch September 24, 2025 02:43
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.

3 participants