Skip to content

Commit 6f9636d

Browse files
committed
[Flight] Use valid CSS selectors in useId format
1 parent f739642 commit 6f9636d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/react-client/src/__tests__/ReactFlight-test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,8 +1957,8 @@ describe('ReactFlight', () => {
19571957
});
19581958
expect(ReactNoop).toMatchRenderedOutput(
19591959
<>
1960-
<div prop=":S1:" />
1961-
<div prop=":S2:" />
1960+
<div prop="«S1»" />
1961+
<div prop="«S2»" />
19621962
</>,
19631963
);
19641964
});
@@ -1981,8 +1981,8 @@ describe('ReactFlight', () => {
19811981
});
19821982
expect(ReactNoop).toMatchRenderedOutput(
19831983
<>
1984-
<div prop=":fooS1:" />
1985-
<div prop=":fooS2:" />
1984+
<div prop="«fooS1»" />
1985+
<div prop="«fooS2»" />
19861986
</>,
19871987
);
19881988
});
@@ -2021,8 +2021,8 @@ describe('ReactFlight', () => {
20212021
assertLog(['ClientDoubler']);
20222022
expect(ReactNoop).toMatchRenderedOutput(
20232023
<>
2024-
<div prop=":S1:">:S1:</div>
2025-
<div prop=":S1:">:S1:</div>
2024+
<div prop="«S1»">«S1»</div>
2025+
<div prop="«S1»">«S1»</div>
20262026
</>,
20272027
);
20282028
});

packages/react-server/src/ReactFlightHooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function useId(): string {
120120
}
121121
const id = currentRequest.identifierCount++;
122122
// use 'S' for Flight components to distinguish from 'R' and 'r' in Fizz/Client
123-
return ':' + currentRequest.identifierPrefix + 'S' + id.toString(32) + ':';
123+
return '\u00AB' + currentRequest.identifierPrefix + 'S' + id.toString(32) + '\u00BB';
124124
}
125125

126126
function use<T>(usable: Usable<T>): T {

0 commit comments

Comments
 (0)