Remove on drop override (#1612)
This PR removes the `onDropOverride` prop from the canvas, which was a bit of a hack. ### Change Type - [x] `major` — Breaking change ### Release Notes - [editor] Remove `onDropOverride`
This commit is contained in:
parent
336cbc7158
commit
99a46af4c8
2 changed files with 3 additions and 14 deletions
|
@ -1,7 +1,7 @@
|
|||
import { Matrix2d, toDomPrecision } from '@tldraw/primitives'
|
||||
import { TLHandle, TLShapeId } from '@tldraw/tlschema'
|
||||
import { dedupe, modulate } from '@tldraw/utils'
|
||||
import * as React from 'react'
|
||||
import React from 'react'
|
||||
import { react } from 'signia'
|
||||
import { track, useValue } from 'signia-react'
|
||||
import { useCanvasEvents } from '../hooks/useCanvasEvents'
|
||||
|
@ -23,13 +23,7 @@ import { Shape } from './Shape'
|
|||
import { ShapeIndicator } from './ShapeIndicator'
|
||||
|
||||
/** @public */
|
||||
export const Canvas = track(function Canvas({
|
||||
onDropOverride,
|
||||
}: {
|
||||
onDropOverride?: (
|
||||
defaultOnDrop: (e: React.DragEvent<Element>) => Promise<void>
|
||||
) => (e: React.DragEvent<Element>) => Promise<void>
|
||||
}) {
|
||||
export const Canvas = track(function Canvas() {
|
||||
const editor = useEditor()
|
||||
|
||||
const { Background, SvgDefs } = useEditorComponents()
|
||||
|
@ -71,9 +65,6 @@ export const Canvas = track(function Canvas({
|
|||
const { context: patternContext, isReady: patternIsReady } = usePattern()
|
||||
|
||||
const events = useCanvasEvents()
|
||||
if (onDropOverride) {
|
||||
events.onDrop = onDropOverride(events.onDrop)
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (patternIsReady && editor.isSafari) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue