File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
packages/react-server/src Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -107,10 +107,7 @@ function useId(): string {
107
107
if ( currentRequest === null ) {
108
108
throw new Error ( 'useId can only be used while React is rendering' ) ;
109
109
}
110
- const prefix = currentRequest.identifierPrefix
111
- ? currentRequest.identifierPrefix
112
- : '';
113
110
const id = currentRequest.identifierCount++;
114
111
// use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
115
- return ':' + prefix + 'S' + id.toString(32) + ':';
112
+ return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
116
113
}
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export type Request = {
108
108
writtenSymbols : Map < Symbol , number> ,
109
109
writtenModules : Map < ModuleKey , number> ,
110
110
writtenProviders : Map < string , number> ,
111
- identifierPrefix ? : string ,
111
+ identifierPrefix : string ,
112
112
identifierCount : number ,
113
113
onError : ( error : mixed ) => void ,
114
114
toJSON : ( key : string , value : ReactModel ) => ReactJSONValue ,
@@ -148,7 +148,7 @@ export function createRequest(
148
148
writtenSymbols : new Map ( ) ,
149
149
writtenModules : new Map ( ) ,
150
150
writtenProviders : new Map ( ) ,
151
- identifierPrefix,
151
+ identifierPrefix : identifierPrefix || '' ,
152
152
identifierCount : 1 ,
153
153
onError : onError === undefined ? defaultErrorHandler : onError ,
154
154
toJSON : function ( key : string , value : ReactModel ) : ReactJSONValue {
You can’t perform that action at this time.
0 commit comments