UNPKG
@twilio-paste/paste-reakit-fork
Version:
latest (1.4.1)
1.4.1
Forked Reakit that addresses SSR hydration issues
twilio-labs/paste-reakit
@twilio-paste/paste-reakit-fork
/
src
/
Composite
/
__utils
/
findFirstEnabledItem.ts
9 lines
(7 loc)
•
253 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{
Item
}
from
"./types"
;
export
function
findFirstEnabledItem
(
items: Item[], excludeId?: string
) {
if
(excludeId) {
return
items.
find
(
(
item
) =>
!item.
disabled
&& item.
id
!== excludeId); }
return
items.
find
(
(
item
) =>
!item.
disabled
); }