Skip to content

fix: replace React.DOM on newer react versions at showConfirmDialog#214

Merged
smarcet merged 1 commit intomainfrom
fix/confirm-dialog-react-version
Apr 9, 2026
Merged

fix: replace React.DOM on newer react versions at showConfirmDialog#214
smarcet merged 1 commit intomainfrom
fix/confirm-dialog-react-version

Conversation

@tomrndom
Copy link
Copy Markdown
Contributor

@tomrndom tomrndom commented Apr 9, 2026

ref: https://app.clickup.com/t/86b94xa4t

Signed-off-by: Tomás Castillo tcastilloboireau@gmail.com

Summary by CodeRabbit

  • Improvements
    • Enhanced the confirm dialog component for improved compatibility with React 18 while maintaining backward compatibility with React 17, ensuring continued stability across React versions.

Signed-off-by: Tomás Castillo <tcastilloboireau@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 427a57c4-11e9-45dd-928b-59978c697dc4

📥 Commits

Reviewing files that changed from the base of the PR and between ecedf60 and 329051b.

📒 Files selected for processing (1)
  • src/components/mui/showConfirmDialog.js

📝 Walkthrough

Walkthrough

The showConfirmDialog component was updated to support React 18's createRoot API while maintaining backward compatibility with React 17. The implementation now conditionally uses the new mounting approach when available, falling back to the legacy ReactDOM.render method for older React versions. Cleanup logic was similarly updated to use root.unmount() or ReactDOM.unmountComponentAtNode() depending on the available API.

Changes

Cohort / File(s) Summary
React 18 Compatibility
src/components/mui/showConfirmDialog.js
Added dynamic import of createRoot from react-dom/client with fallback to legacy ReactDOM API. Conditional rendering uses root.render() for React 18+ or ReactDOM.render() for React 17. Cleanup similarly branches to root.unmount() or ReactDOM.unmountComponentAtNode() based on API availability.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through React's grand hall,
Where eighteen dances with seventeen's call,
createRoot whispers, "I'm new and bright,"
Yet legacy render still feels just right!
✨ Compatibility blooms—bugs take flight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: updating showConfirmDialog to support newer React versions by replacing React.DOM usage with the createRoot API while maintaining backwards compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/confirm-dialog-react-version

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tomrndom tomrndom requested a review from smarcet April 9, 2026 13:18
Copy link
Copy Markdown
Collaborator

@smarcet smarcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smarcet smarcet merged commit 094c6b9 into main Apr 9, 2026
5 checks passed
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.

2 participants