mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-19 18:23:06 +03:00
Use createRoot instead of deprecated ReactDOM.render
I foresee this change being made across the codebase shortly and want to proactively prevent my PR from falling behind
This commit is contained in:
parent
3541391747
commit
16ad8146c5
1 changed files with 2 additions and 1 deletions
|
@ -8,6 +8,7 @@ Please see LICENSE files in the repository root for full details.
|
|||
|
||||
import React, { createRef, SyntheticEvent, MouseEvent } from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { MsgType, PushRuleKind } from "matrix-js-sdk/src/matrix";
|
||||
import { TooltipProvider } from "@vector-im/compound-web";
|
||||
import { globToRegexp } from "matrix-js-sdk/src/utils";
|
||||
|
@ -255,7 +256,7 @@ export default class TextualBody extends React.Component<IBodyProps, IState> {
|
|||
{after}
|
||||
</>
|
||||
);
|
||||
ReactDOM.render(newContent, container);
|
||||
createRoot(container).render(newContent);
|
||||
|
||||
node.parentNode?.replaceChild(container, node);
|
||||
} else if (node.childNodes && node.childNodes.length) {
|
||||
|
|
Loading…
Reference in a new issue