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

SAP / ui5-webcomponents-react / 3658276346

pending completion
3658276346

Pull #3856

github

GitHub
Merge 5d0b46815 into beb032e09
Pull Request #3856: fix(Modals - TypeScript): allow typing the container element

3040 of 6031 branches covered (50.41%)

63 of 63 new or added lines in 3 files covered. (100.0%)

4225 of 5253 relevant lines covered (80.43%)

1079.1 hits per line

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

30.77
/packages/base/src/hooks/useIsomorphicId.ts
1
import * as React from 'react';
2

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

11
const canUseUseId = 'useId' in React;
143✔
12

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

19
  const localId = React.useRef(getRandomId());
×
20
  return localId.current;
×
21
}
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