33import type { Commit } from '../../../index'
44import type { GraphRow } from '../../lib/commit-graph'
55import type { GitRef } from '../../lib/refs'
6- import { useEffect , useMemo , useRef } from 'react'
6+ import { memo , useEffect , useMemo , useRef } from 'react'
77import { computeGraph } from '../../lib/commit-graph'
88import { parseRefs } from '../../lib/refs'
99import { cn } from '../../lib/utils'
@@ -165,7 +165,7 @@ function RefLabel({ refToken, color }: { refToken: GitRef, color: string }) {
165165 )
166166}
167167
168- function CommitRow ( { commit, row, gutter, currentBranch, isHead, topStub, selected, onSelect } : {
168+ const CommitRow = memo ( ( { commit, row, gutter, currentBranch, isHead, topStub, selected, onSelect } : {
169169 commit : Commit
170170 row : GraphRow
171171 gutter : number
@@ -174,7 +174,7 @@ function CommitRow({ commit, row, gutter, currentBranch, isHead, topStub, select
174174 topStub : boolean
175175 selected : boolean
176176 onSelect ?: ( hash : string ) => void
177- } ) {
177+ } ) => {
178178 const refs = useMemo ( ( ) => parseRefs ( commit . refs , currentBranch ) , [ commit . refs , currentBranch ] )
179179 const hasCurrent = refs . some ( r => r . kind === 'branch' && r . current )
180180
@@ -222,7 +222,7 @@ function CommitRow({ commit, row, gutter, currentBranch, isHead, topStub, select
222222 </ button >
223223 </ li >
224224 )
225- }
225+ } )
226226
227227function WipRow ( { col, color, gutter, changes } : {
228228 col : number
0 commit comments