Skip to content

Commit

Permalink
fix(Core): remove devTools temporarily
Browse files Browse the repository at this point in the history
avoid SSR warning with different uid
  • Loading branch information
Barrior committed Jan 5, 2024
1 parent 0309254 commit 6c4adf8
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/core-react/src/Core.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -45,8 +44,7 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref<ICoreRef>) => {
const rootContextRef = useRef<IRootContext>({} as IRootContext)

// 表单数据 value 控制
const { value, valueRef, onChange, getValue, setValue, resetValue } =
useCoreValue(props)
const { value, onChange, getValue, setValue, resetValue } = useCoreValue(props)

// 合并语言
const locale = useMemo(
Expand All @@ -63,10 +61,6 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref<ICoreRef>) => {
[props.renderers]
)

// 注册 DevTool
// uid: 当前实例唯一 ID
const { uid } = useDevTool({ valueRef, props })

// 计算布局样式
const layoutStyle = useLayoutStyle(props)

Expand Down Expand Up @@ -111,7 +105,6 @@ const InnerCore = forwardRef((coreProps: ICore, ref?: Ref<ICoreRef>) => {
...props.style,
...layoutStyle,
}}
data-sr-id={uid}
>
<RendererIterator schema={rootCtxVal.rootSchema} path={[]} />
</div>
Expand Down

0 comments on commit 6c4adf8

Please sign in to comment.