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 {
107107 if ( currentRequest === null ) {
108108 throw new Error ( 'useId can only be used while React is rendering' ) ;
109109 }
110- const prefix = currentRequest.identifierPrefix
111- ? currentRequest.identifierPrefix
112- : '';
113110 const id = currentRequest.identifierCount++;
114111 // 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) + ':';
116113}
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ export type Request = {
108108 writtenSymbols : Map < Symbol , number> ,
109109 writtenModules : Map < ModuleKey , number> ,
110110 writtenProviders : Map < string , number> ,
111- identifierPrefix ? : string ,
111+ identifierPrefix : string ,
112112 identifierCount : number ,
113113 onError : ( error : mixed ) => void ,
114114 toJSON : ( key : string , value : ReactModel ) => ReactJSONValue ,
@@ -148,7 +148,7 @@ export function createRequest(
148148 writtenSymbols : new Map ( ) ,
149149 writtenModules : new Map ( ) ,
150150 writtenProviders : new Map ( ) ,
151- identifierPrefix,
151+ identifierPrefix : identifierPrefix || '' ,
152152 identifierCount : 1 ,
153153 onError : onError === undefined ? defaultErrorHandler : onError ,
154154 toJSON : function ( key : string , value : ReactModel ) : ReactJSONValue {
You can’t perform that action at this time.
0 commit comments