Revert "Refactor components to remove forwardRef and simplify props handling"
This reverts commit 1cd013fb94.
This commit is contained in:
@@ -15,11 +15,11 @@ import {
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import { useLockFn } from "ahooks";
|
||||
import yaml from "js-yaml";
|
||||
import { useImperativeHandle, useState, useEffect } from "react";
|
||||
import { forwardRef, useImperativeHandle, useState, useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import MonacoEditor from "react-monaco-editor";
|
||||
|
||||
import { BaseDialog, Switch } from "@/components/base";
|
||||
import { BaseDialog, DialogRef, Switch } from "@/components/base";
|
||||
import { useClash } from "@/hooks/use-clash";
|
||||
import { showNotice } from "@/services/noticeService";
|
||||
import { useThemeMode } from "@/services/states";
|
||||
@@ -87,7 +87,7 @@ const DEFAULT_DNS_CONFIG = {
|
||||
},
|
||||
};
|
||||
|
||||
export const DnsViewer = ({ ref, ...props }) => {
|
||||
export const DnsViewer = forwardRef<DialogRef>((props, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const { clash, mutateClash } = useClash();
|
||||
const themeMode = useThemeMode();
|
||||
@@ -1034,4 +1034,4 @@ export const DnsViewer = ({ ref, ...props }) => {
|
||||
)}
|
||||
</BaseDialog>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user