From 6c4adf82552972cda31b405e9c17705c8346368e Mon Sep 17 00:00:00 2001 From: Barrior Date: Fri, 5 Jan 2024 13:53:59 +0800 Subject: [PATCH] fix(Core): remove devTools temporarily avoid SSR warning with different uid --- packages/core-react/src/Core.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/core-react/src/Core.tsx b/packages/core-react/src/Core.tsx index d978bb9..3dafb06 100644 --- a/packages/core-react/src/Core.tsx +++ b/packages/core-react/src/Core.tsx @@ -3,7 +3,6 @@ import { forwardRef, useMemo, useRef } from 'react' import ErrorBoundary from './components/ErrorBoundary' import useCoreValue from './hooks/useCoreValue' -import useDevTool from './hooks/useDevTool' import useLayoutStyle, { LAYOUT_MIN_MAX } from './hooks/useLayoutStyle' import useOpenApi from './hooks/useOpenApi' import zhCN from './locale/zh_CN' @@ -45,8 +44,7 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref) => { const rootContextRef = useRef({} as IRootContext) // 表单数据 value 控制 - const { value, valueRef, onChange, getValue, setValue, resetValue } = - useCoreValue(props) + const { value, onChange, getValue, setValue, resetValue } = useCoreValue(props) // 合并语言 const locale = useMemo( @@ -63,10 +61,6 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref) => { [props.renderers] ) - // 注册 DevTool - // uid: 当前实例唯一 ID - const { uid } = useDevTool({ valueRef, props }) - // 计算布局样式 const layoutStyle = useLayoutStyle(props) @@ -111,7 +105,6 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref) => { ...props.style, ...layoutStyle, }} - data-sr-id={uid} >