We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee109b4 commit 37f2879Copy full SHA for 37f2879
src/ActionList/Item.tsx
@@ -1,5 +1,5 @@
1
import {CheckIcon, IconProps} from '@primer/octicons-react'
2
-import React, {useCallback} from 'react'
+import React, {useCallback, useMemo} from 'react'
3
import {get} from '../constants'
4
import sx, {SxProp} from '../sx'
5
import Truncate from '../Truncate'
@@ -307,10 +307,12 @@ export function Item(itemProps: Partial<ItemProps> & {item?: ItemInput}): JSX.El
307
onKeyPress,
308
children,
309
onClick,
310
- id = uniqueId(),
+ id: _id,
311
...props
312
} = itemProps
313
314
+ const id = useMemo(() => _id ?? uniqueId(), [_id])
315
+
316
const keyPressHandler = useCallback(
317
event => {
318
if (disabled) {
0 commit comments