mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 09:57:08 -04:00
Add React eslint & update depencenies (#3090)
Co-authored-by: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
This commit is contained in:
parent
16a1c44947
commit
7be3a40b7c
56 changed files with 2025 additions and 1529 deletions
|
@ -47,7 +47,7 @@ export interface ModalOptions {
|
|||
onCloseCallback?: (() => void);
|
||||
}
|
||||
|
||||
type RenderFunction = (props: ModalProps) => ReactNode;
|
||||
type RenderFunction = (props: ModalProps) => ReactNode | Promise<ReactNode>;
|
||||
|
||||
export const Modals = findByPropsLazy("ModalRoot", "ModalCloseButton") as {
|
||||
ModalRoot: ComponentType<PropsWithChildren<{
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
|
||||
import { React, useEffect, useMemo, useReducer, useState } from "@webpack/common";
|
||||
import { ActionDispatch } from "react";
|
||||
|
||||
import { checkIntersecting } from "./misc";
|
||||
|
||||
|
@ -117,8 +118,8 @@ export function useAwaiter<T>(factory: () => Promise<T>, providedOpts?: AwaiterO
|
|||
/**
|
||||
* Returns a function that can be used to force rerender react components
|
||||
*/
|
||||
export function useForceUpdater(): () => void;
|
||||
export function useForceUpdater(withDep: true): [unknown, () => void];
|
||||
export function useForceUpdater(): ActionDispatch<[]>;
|
||||
export function useForceUpdater(withDep: true): [any, ActionDispatch<[]>];
|
||||
export function useForceUpdater(withDep?: true) {
|
||||
const r = useReducer(x => x + 1, 0);
|
||||
return withDep ? r : r[1];
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
import { Command } from "@api/Commands";
|
||||
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { FluxEvents } from "@webpack/types";
|
||||
import { JSX } from "react";
|
||||
import { Promisable } from "type-fest";
|
||||
|
||||
// exists to export default definePlugin({...})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue