Fix the reaction content type and the fixable lint sites. [skip build]
This commit is contained in:
1 parent
9d17b14a9e
commit
b85a2b9290
7 files changed
+25
-18
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, { useEffect, useMemo, useRef } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { EmojiConfettiBurst } from './types';
|
||||
import {
|
||||
@@ -238,7 +238,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
[burst.origin.maskRadius, canvasSize],
|
||||
);
|
||||
|
||||
const updateLayerPosition = () => {
|
||||
const updateLayerPosition = useCallback(() => {
|
||||
const layer = layerRef.current;
|
||||
if (!layer) return false;
|
||||
|
||||
@@ -249,7 +249,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
layer.style.left = `${rect.left + rect.width / 2 - canvasSize / 2}px`;
|
||||
layer.style.top = `${rect.top + rect.height / 2 - canvasSize / 2}px`;
|
||||
return true;
|
||||
};
|
||||
}, [burst.targetEventId, canvasSize]);
|
||||
|
||||
useEffect(() => {
|
||||
const onScrollOrResize = () => {
|
||||
@@ -263,7 +263,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
window.removeEventListener('scroll', onScrollOrResize, true);
|
||||
window.removeEventListener('resize', onScrollOrResize);
|
||||
};
|
||||
}, [burst.targetEventId, canvasSize]);
|
||||
}, [burst.targetEventId, canvasSize, updateLayerPosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!canvasRef.current || spawnedRef.current) return undefined;
|
||||
@@ -348,7 +348,7 @@ function LocalBurstCanvas({ burst, primaryEmoji, onComplete }: BurstCanvasProps)
|
||||
window.clearInterval(retry);
|
||||
frameCleanup?.();
|
||||
};
|
||||
}, [burst.id, burst.targetEventId, canvasSize, localOrigin, primaryEmoji]);
|
||||
}, [burst.id, burst.targetEventId, canvasSize, localOrigin, primaryEmoji, updateLayerPosition]);
|
||||
|
||||
return createPortal(
|
||||
<div
|
||||
|
||||
Reference in new issue
Block a user