Use selectedSpanIdRef to avoid capturing stale selectedSpanId in the keyboard event handler closure. Wrap handleDeleteSpan in useCallback with stable dependencies (reads selectedSpanIdRef.current instead of the prop directly). Remove selectedSpanId from the useEffect dependency array since the ref is used instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| archive | ||
| code-review-fix | ||