SPFX Pretty

Home › How to fix › Versions

VER011Needs you

Legacy ReactDom.render on React 18

Why it matters

ReactDom.render runs React 18 in React 17 mode - you miss concurrent features and get console warnings.

How to fix

  1. Create one root per web part: this._root = createRoot(this.domElement); this._root.render(element);
  2. In onDispose: this._root?.unmount();

Microsoft articles

In VS Code: right-click the finding → Explain & How to Fix, or use ▶ Fix step by step in the report.