Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Your Code Never Calls findDOMNode. Your Dependency Still Does.

React 19 removed findDOMNode . Search your src folder for it and you will probably find nothing. Then I installed one very popular animation package in an empty folder and searched again: npm install react-transition-group@4.4.5 react@18 react-dom@18 grep -rn "findDOMNode" node_modules/react-transition-group/cjs/*.js node_modules/react-transition-group/cjs/ReplaceTransition.js:106: var maybeNode…

React 19 removed the findDOMNode function. Many React developers may not be aware that their dependencies may still be calling this deprecated function. To address this issue, a new tool named Since has been developed. Since scans through dependencies and identifies if they are making calls to the removed function. The tool takes into account the version of the dependency and whether the removed function is still being called in a version that the app is using.

One example of how Since works is with the popular animation package react-transition-group. In an empty folder, installing react-transition-group@4.4.5 and react-dom@18 revealed four calls to findDOMNode. Since then, the tool has been refined to provide more accurate results. It now checks the package's peer range to ensure that it can still call a function that has been removed in a newer version of a dependency.

Furthermore, it matches the call to the removal based on the complete path of what was removed, rather than just the last segment of the name.

Once a dependency is identified as making a call to the removed function, the tool provides the file and line number inside the dependency where the call can be found. This information is then displayed in the app's own lines, allowing developers to address the issue more efficiently. Despite some limitations, such as a public scan keeping the first 100 findings, Since is an essential tool for developers to ensure their code remains compatible with React 19 and its new features.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

GitHub Advanced Security alerts: prioritise with runtime context

On Monday morning the security tab of your GitHub organisation shows thousands of Dependabot and code scanning findings. Nobody can fix them all this week, so the operational question is: which ones…

  • GitHub alerts overwhelm security tab with thousands of findings
  • Dynatrace provides runtime context to prioritize critical vulnerabilities
  • Implementing process reduces noise and improves issue resolution time

How to Run a Pre-Mortem: A Launch Facilitation Script and Template

A pre-mortem assumes your launch already failed and asks why. Here is Gary Klein's method, Shreyas Doshi's Tigers framework, a word-for-word script and a template. A pre-mortem is a short meeting in which the team imagines a launch has already failed and writes down why.

  • Pre-mortem assumes launch failure to identify risks missed in planning meetings
  • 20-30 minute exercise reduces overconfidence more than critiques or lists
  • Tigers framework includes at least two clear threats per person in pre-mortem

More from Saturday 21 November →