( resumableState: ResumableState, treeId: string, localId: number, )
| 1089 | } |
| 1090 | |
| 1091 | export function makeId( |
| 1092 | resumableState: ResumableState, |
| 1093 | treeId: string, |
| 1094 | localId: number, |
| 1095 | ): string { |
| 1096 | const idPrefix = resumableState.idPrefix; |
| 1097 | |
| 1098 | let id = '_' + idPrefix + 'R_' + treeId; |
| 1099 | |
| 1100 | // Unless this is the first id at this level, append a number at the end |
| 1101 | // that represents the position of this useId hook among all the useId |
| 1102 | // hooks for this fiber. |
| 1103 | if (localId > 0) { |
| 1104 | id += 'H' + localId.toString(32); |
| 1105 | } |
| 1106 | |
| 1107 | return id + '_'; |
| 1108 | } |
| 1109 | |
| 1110 | function encodeHTMLTextNode(text: string): string { |
| 1111 | return escapeTextForBrowser(text); |
no test coverage detected