Skip to content

Commit fac78af

Browse files
authored
[test] Add findSourceMapURL to ReactNoopFlightClient (#30395)
1 parent 66df944 commit fac78af

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/react-noop-renderer/src/ReactNoopFlightClient.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* environment.
1515
*/
1616

17+
import type {FindSourceMapURLCallback} from 'react-client/flight';
18+
1719
import {readModule} from 'react-noop-renderer/flight-modules';
1820

1921
import ReactFlightClient from 'react-client/flight';
@@ -49,15 +51,19 @@ const {createResponse, processBinaryChunk, getRoot, close} = ReactFlightClient({
4951
},
5052
});
5153

52-
function read<T>(source: Source): Thenable<T> {
54+
type ReadOptions = {|
55+
findSourceMapURL?: FindSourceMapURLCallback,
56+
|};
57+
58+
function read<T>(source: Source, options: ReadOptions): Thenable<T> {
5359
const response = createResponse(
5460
source,
5561
null,
5662
undefined,
5763
undefined,
5864
undefined,
5965
undefined,
60-
undefined,
66+
options !== undefined ? options.findSourceMapURL : undefined,
6167
true,
6268
);
6369
for (let i = 0; i < source.length; i++) {

0 commit comments

Comments
 (0)