Skip to content

🎥 Make videos programmatically with React

fix clicking fast

Jonny Burger96bc825127dd
diff --git a/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx b/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
index a540cff27f..23ef2c79ef 100644
--- a/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
+++ b/packages/cli/src/editor/components/RenderModal/WarningIndicatorButton.tsx
@@ -1,5 +1,5 @@
import type {SVGProps} from 'react';
-import React, {useMemo} from 'react';
+import React, {useCallback, useMemo} from 'react';
import {
INPUT_BACKGROUND,
INPUT_BORDER_COLOR_HOVERED,
@@ -45,9 +45,9 @@ export const WarningIndicatorButton: React.FC<{
showWarning: boolean;
warningCount: number;
}> = ({setShowWarning, showWarning, warningCount}) => {
- const onClick = () => {
- setShowWarning(!showWarning);
- };
+ const onClick = useCallback(() => {
+ setShowWarning((s) => !s);
+ }, [setShowWarning]);
const buttonStyle: React.CSSProperties = useMemo(() => {
return {