fix: a strange Reaction error issue

This commit is contained in:
Peng Xiao
2022-09-10 01:03:53 +08:00
parent db51313ee1
commit 8f7510fc73
2 changed files with 1 additions and 5 deletions

View File

@@ -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.')