Closed lynchee-owo closed 3 months ago
You are using
useEffect
in the PR. It's probably the most misused hook of React. Although this PR is still in draft, I want to remind you to think about the lifecycle of the effects, and how to make sure the dependency array is carefully set up.If this is new to you, please spend some time read
I think for handling the case "run task immediately" when stop listening, could use an alternative approach than creating an event "document.dispatchEvent(new CustomEvent("stopListening"))" and listen it, could rewrite it in the state management way
You are using
useEffect
in the PR. It's probably the most misused hook of React. Although this PR is still in draft, I want to remind you to think about the lifecycle of the effects, and how to make sure the dependency array is carefully set up.If this is new to you, please spend some time read