Skip to content

Conversation

@greglittlefield-wf
Copy link
Collaborator

Motivation

In React 18, each react_dom.render call emits the following console.error message:

Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

Since we likely won't be adding support for createRoot until after we've switched to React 18, consumers won't be able to address these errors, and they'd be quite noisy in the meantime.

Solution

  • Suppress console.error messages warning about ReactDOM.render's deprecation
  • Add regression test
  • Remove / repurpose old console.warn wrapping for similar message suppression, which isn't needed in Dart 2.14+
    • Up SDK constraint to 2.14 (could probably be higher, but that's out of scope)
    • Remove old "legacy" test configs

Testing instructions

  • CI passes
  • Regression test, added in 52f1a56, fails before the fix was added

@greglittlefield-wf greglittlefield-wf changed the title Suppress react_dom render warnings FED-3282 Suppress react_dom render warnings Jan 27, 2025
@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review January 27, 2025 23:55
Copy link
Collaborator

@sydneyjodon-wk sydneyjodon-wk left a comment

Choose a reason for hiding this comment

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

+10 🎉

  • CI passes
  • Regression test, added in 52f1a56, fails before the fix was added

@greglittlefield-wf
Copy link
Collaborator Author

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@btr-rmconsole-6 btr-rmconsole-6 bot merged commit 74d3a4d into react-18-2-0 Jan 29, 2025
4 checks passed
@btr-rmconsole-6 btr-rmconsole-6 bot deleted the suppress-react-dom-render-warnings branch January 29, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants