mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-04-16 23:40:32 +08:00
refactor: useLayoutEffect
This commit is contained in:
parent
d05bcc17f7
commit
886d1a551a
@ -6,7 +6,7 @@ import {
|
|||||||
} from "@mui/x-data-grid";
|
} from "@mui/x-data-grid";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { useLocalStorage } from "foxact/use-local-storage";
|
import { useLocalStorage } from "foxact/use-local-storage";
|
||||||
import { useEffect, useMemo, useState } from "react";
|
import { useLayoutEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
import parseTraffic from "@/utils/parse-traffic";
|
import parseTraffic from "@/utils/parse-traffic";
|
||||||
@ -21,7 +21,7 @@ export const ConnectionTable = (props: Props) => {
|
|||||||
const { connections, onShowDetail } = props;
|
const { connections, onShowDetail } = props;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const apiRef = useGridApiRef();
|
const apiRef = useGridApiRef();
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
const PATCH_FLAG_KEY = "__clashPatchedPublishEvent" as const;
|
const PATCH_FLAG_KEY = "__clashPatchedPublishEvent" as const;
|
||||||
const ORIGINAL_KEY = "__clashOriginalPublishEvent" as const;
|
const ORIGINAL_KEY = "__clashOriginalPublishEvent" as const;
|
||||||
let isUnmounted = false;
|
let isUnmounted = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user