mirror of
https://github.com/Davilarek/Vencord.git
synced 2025-05-11 01:45:39 +02:00
Fix ReactDOM
This commit is contained in:
parent
661d8a0321
commit
c44aee78a1
1 changed files with 7 additions and 3 deletions
|
@ -152,7 +152,7 @@ export const WebpackHolder = {
|
|||
byPrototypeKeys(fields) {
|
||||
return x =>
|
||||
x.prototype &&
|
||||
fields.every(field => field in x.prototype);
|
||||
[...fields.flat()].every(field => field in x.prototype);
|
||||
},
|
||||
},
|
||||
getModule: BdApi_getModule,
|
||||
|
@ -228,7 +228,7 @@ export const WebpackHolder = {
|
|||
},
|
||||
getByStrings(...strings) {
|
||||
const moreOpts = getOptions(strings);
|
||||
return this.getModule(this.Filters.byStrings(...strings), moreOpts);
|
||||
return this.getModule(this.Filters.byStrings(...strings.flat()), moreOpts);
|
||||
},
|
||||
getBySource(...strings) {
|
||||
const moreOpts = getOptions(strings);
|
||||
|
@ -351,6 +351,8 @@ type SettingsType = {
|
|||
options?: { label: string, value: number }[],
|
||||
};
|
||||
|
||||
const _ReactDOM_With_createRoot = {} as typeof Vencord.Webpack.Common.ReactDOM & { createRoot: typeof Vencord.Webpack.Common.createRoot };
|
||||
|
||||
export const UIHolder = {
|
||||
alert(title: string, content: any) {
|
||||
return this.showConfirmationModal(title, content, { cancelText: null });
|
||||
|
@ -864,7 +866,9 @@ class BdApiReImplementationInstance {
|
|||
enableSetting(collection, category, id) { }
|
||||
disableSetting(collection, category, id) { }
|
||||
get ReactDOM() {
|
||||
return WebpackHolder.getModule(x => x.render && x.findDOMNode);
|
||||
if (_ReactDOM_With_createRoot.createRoot === undefined)
|
||||
Object.assign(_ReactDOM_With_createRoot, { ...Vencord.Webpack.Common.ReactDOM, createRoot: Vencord.Webpack.Common.createRoot });
|
||||
return _ReactDOM_With_createRoot;
|
||||
}
|
||||
get ReactUtils() {
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue