Revert "Refactor components to remove forwardRef and simplify props handling"
This reverts commit 1cd013fb94.
This commit is contained in:
@@ -12,15 +12,15 @@ import {
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import { useLockFn } from "ahooks";
|
||||
import { useImperativeHandle, useState } from "react";
|
||||
import { forwardRef, useImperativeHandle, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { BaseDialog, Switch } from "@/components/base";
|
||||
import { BaseDialog, DialogRef, Switch } from "@/components/base";
|
||||
import { useClashInfo } from "@/hooks/use-clash";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
|
||||
export const ControllerViewer = ({ ref, ...props }) => {
|
||||
export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [copySuccess, setCopySuccess] = useState<null | string>(null);
|
||||
@@ -217,4 +217,4 @@ export const ControllerViewer = ({ ref, ...props }) => {
|
||||
</Snackbar>
|
||||
</BaseDialog>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user