mirror of
https://github.com/Equicord/Equicord.git
synced 2025-07-03 02:03:58 -04:00
Merge Dev & Fixes
This commit is contained in:
commit
b9e07cbe0f
9 changed files with 24 additions and 23 deletions
|
@ -21,7 +21,7 @@ import { disableStyle, enableStyle } from "@api/Styles";
|
|||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, MessageStore, ReactDOM, Toasts } from "@webpack/common";
|
||||
import { ChannelStore, createRoot, MessageStore, Toasts } from "@webpack/common";
|
||||
import Message from "discord-types/general/Message";
|
||||
import { Root } from "react-dom/client";
|
||||
|
||||
|
@ -101,7 +101,7 @@ export default definePlugin({
|
|||
madeComponent = true;
|
||||
element = document.createElement("div");
|
||||
document.querySelector("[class^=base_]")!.appendChild(element);
|
||||
root = ReactDOM.createRoot(element);
|
||||
root = createRoot(element);
|
||||
}
|
||||
root!.render(<ReplyNavigator replies={replies} />);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import { saveFile } from "@utils/web";
|
||||
import { filters, findAll, findByPropsLazy, waitFor } from "@webpack";
|
||||
import { React, ReactDOM } from "@webpack/common";
|
||||
import { createRoot, React, ReactDOM } from "@webpack/common";
|
||||
import * as t from "@webpack/types";
|
||||
export let _cssColors: string[] = [];
|
||||
export type IconsDef = { [k: string]: t.Icon; };
|
||||
|
@ -82,7 +82,7 @@ export function saveIcon(iconName: string, icon: EventTarget & SVGSVGElement | E
|
|||
|
||||
export function convertComponentToHtml(component?: React.ReactElement): string {
|
||||
const container = document.createElement("div");
|
||||
const root = ReactDOM.createRoot(container);
|
||||
const root = createRoot(container);
|
||||
|
||||
ReactDOM.flushSync(() => root.render(component));
|
||||
const content = container.innerHTML;
|
||||
|
|
|
@ -9,7 +9,7 @@ import "./styles.css";
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { FluxDispatcher, ReactDOM, useEffect, useState } from "@webpack/common";
|
||||
import { createRoot, FluxDispatcher, useEffect, useState } from "@webpack/common";
|
||||
import { Root } from "react-dom/client";
|
||||
|
||||
let jumpscareRoot: Root | undefined;
|
||||
|
@ -38,7 +38,7 @@ function getJumpscareRoot(): Root {
|
|||
element.id = "jumpscare-root";
|
||||
element.classList.add("jumpscare-root");
|
||||
document.body.append(element);
|
||||
jumpscareRoot = ReactDOM.createRoot(element);
|
||||
jumpscareRoot = createRoot(element);
|
||||
}
|
||||
|
||||
return jumpscareRoot;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { React, ReactDOM } from "@webpack/common";
|
||||
import { createRoot, React } from "@webpack/common";
|
||||
import type { JSX, ReactNode } from "react";
|
||||
import type { Root } from "react-dom/client";
|
||||
|
||||
|
@ -32,7 +32,7 @@ function getNotificationContainer() {
|
|||
const container = document.createElement("div");
|
||||
container.id = "toastnotifications-container";
|
||||
document.body.append(container);
|
||||
RootContainer = ReactDOM.createRoot(container);
|
||||
RootContainer = createRoot(container);
|
||||
}
|
||||
|
||||
return RootContainer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue