Remove debugging statement when generating drag previews (#36)

This commit is contained in:
Evan Simkowitz 2024-06-11 13:25:21 -07:00 committed by GitHub
parent 92dc82967c
commit 1be376c679
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -275,7 +275,6 @@ const TileNode = <T,>({
// No-op if not provided, meaning React-DnD will attempt to generate a preview from the DOM, which is very slow.
const preview = useMemo(() => {
const previewElement = renderPreview?.(layoutNode.data);
console.log("preview", previewElement);
return (
<div className="tile-preview-container">
<div className="tile-preview" ref={previewRef}>
@ -289,10 +288,8 @@ const TileNode = <T,>({
// I found a hacky workaround of just adding a timeout so the capture doesn't happen until after the first paint.
useEffect(
debounce(() => {
console.log("dragPreview effect");
if (previewRef.current) {
toPng(previewRef.current).then((url) => {
console.log("got preview url", url);
const img = new Image();
img.src = url;
dragPreview(img);