Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.ui

Migrate off legacy ReactDOM render entrypoints

`render`, `hydrate`, and `unmountComponentAtNode` from `react-dom` are legacy APIs replaced by the `createRoot` and `hydrateRoot` clients.

#Metadata

Rule ID
ts.react.no-deprecated-react-dom-root-api
Severity
medium
Confidence
0.88
Languages
javascript, typescript
Presets
strict
Stability
experimental
Applies to
function
Tags
react, rules-catalog, ui

#Why it matters

The concurrent renderer expects roots created through the client API; legacy entrypoints block adoption of React 18 streaming and suspense features.

#Remediation

Import `createRoot` or `hydrateRoot` from `react-dom/client`, create a root once, and use `root.render` for updates instead of legacy `ReactDOM.render`.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.react.no-deprecated-react-dom-root-api.rule.yaml.