• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SAP / ui5-webcomponents-react / 13967364376

20 Mar 2025 10:40AM CUT coverage: 88.959%. First build
13967364376

Pull #7114

github

web-flow
Merge 59e4be53e into 7f3bbaf1f
Pull Request #7114: fix(VariantManagement): allow quotes in VariantItem name

3143 of 4086 branches covered (76.92%)

1 of 1 new or added line in 1 file covered. (100.0%)

5624 of 6322 relevant lines covered (88.96%)

44946.26 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/packages/base/src/hooks/useIsomorphicId.ts
1
'use client';
2

3
import * as React from 'react';
4

5
function getRandomId() {
6
  if ('randomUUID' in crypto) {
×
7
    return crypto.randomUUID();
×
8
  }
9
  const uint32 = window.crypto.getRandomValues(new Uint32Array(1))[0];
×
10
  return uint32.toString(16);
×
11
}
12

13
const canUseUseId = 'useId' in React;
457✔
14

15
export function useIsomorphicId(): string {
16
  if (canUseUseId) {
77,893✔
17
    // TODO might be fixed by https://github.com/webpack/webpack/issues/14814
18
    return Reflect.get(React, 'useId')();
77,893✔
19
  }
20

21
  // eslint-disable-next-line react-hooks/rules-of-hooks
22
  const localId = React.useRef(getRandomId()); // React version never changes at runtime
×
23
  return localId.current;
×
24
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc