浏览代码

fix: a strange Reaction error issue

Peng Xiao 3 年之前
父节点
当前提交
8f7510fc73

+ 0 - 1
tldraw/packages/core/src/lib/TLPage/TLPage.ts

@@ -42,7 +42,6 @@ export class TLPage<S extends TLShape = TLShape, E extends TLEventMap = TLEventM
         shapes: toJS(this.shapes.map(shape => toJS(shape.props))),
         bindings: toJS(this.bindings),
         nonce: this.nonce,
-        editingShape: toJS(this.app.editingShape),
       }),
       (curr, prev) => {
         if (this.app.isInAny('creating')) return

+ 1 - 4
tldraw/packages/react/src/components/ContextBarContainer/ContextBarContainer.tsx

@@ -2,7 +2,6 @@ import * as React from 'react'
 import { observer } from 'mobx-react-lite'
 import { TLBounds, BoundsUtils, TLOffset } from '@tldraw/core'
 import { useRendererContext, useCounterScaledPosition } from '../../hooks'
-import { useDebouncedValue } from '../../hooks/useDebounced'
 import type { TLReactShape } from '../../lib'
 
 const stopEventPropagation = (e: React.PointerEvent) => e.stopPropagation()
@@ -16,7 +15,7 @@ export interface TLContextBarContainerProps<S extends TLReactShape> {
 
 export const ContextBarContainer = observer(function ContextBarContainer<S extends TLReactShape>({
   shapes,
-  hidden: _hidden,
+  hidden,
   bounds,
   rotation = 0,
 }: TLContextBarContainerProps<S>) {
@@ -35,8 +34,6 @@ export const ContextBarContainer = observer(function ContextBarContainer<S exten
   const rotatedBounds = BoundsUtils.getRotatedBounds(bounds, rotation)
   const scaledBounds = BoundsUtils.multiplyBounds(rotatedBounds, zoom)
 
-  const hidden = useDebouncedValue(_hidden, 200)
-
   useCounterScaledPosition(rBounds, bounds, rotation, 10003)
 
   if (!ContextBar) throw Error('Expected a ContextBar component.')