()
| 732 | } |
| 733 | |
| 734 | function useId(): string { |
| 735 | const task: Task = (currentlyRenderingTask: any); |
| 736 | const treeId = getTreeId(task.treeContext); |
| 737 | |
| 738 | const resumableState = currentResumableState; |
| 739 | if (resumableState === null) { |
| 740 | throw new Error( |
| 741 | 'Invalid hook call. Hooks can only be called inside of the body of a function component.', |
| 742 | ); |
| 743 | } |
| 744 | |
| 745 | const localId = localIdCounter++; |
| 746 | return makeId(resumableState, treeId, localId); |
| 747 | } |
| 748 | |
| 749 | function use<T>(usable: Usable<T>): T { |
| 750 | if (usable !== null && typeof usable === 'object') { |
no test coverage detected