Skip to content

Commit 6f2d1a5

Browse files
committed
Refactor EventCaptureSection to remove unnecessary useEffect
- Removed the useEffect hook that synchronized the input with the store value, simplifying the component's logic. - This change enhances performance by reducing unnecessary re-renders and dependencies.
1 parent 79e5276 commit 6f2d1a5

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/pages/options/components/EventCaptureSection.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from 'react';
1+
import { useState } from 'react';
22

33
import {
44
Card,
@@ -17,12 +17,6 @@ export const EventCaptureSection = () => {
1717
const [maxEventsInput, setMaxEventsInput] = useState(maxEvents.toString());
1818
const [maxEventsError, setMaxEventsError] = useState('');
1919

20-
// Sync input with store value when it changes externally (e.g., reset)
21-
useEffect(() => {
22-
setMaxEventsInput(maxEvents.toString());
23-
setMaxEventsError('');
24-
}, [maxEvents]);
25-
2620
const handleMaxEventsBlur = () => {
2721
const value = parseInt(maxEventsInput, 10);
2822
if (isNaN(value)) {

0 commit comments

Comments
 (0)