Skip to content

Commit c94f72d

Browse files
committed
Add extra fetch properties if there were any
1 parent 3ea86d0 commit c94f72d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/react/src/ReactFetch.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ if (enableCache && enableFetchInstrumentation) {
118118
// of the body so that it can be read multiple times.
119119
return match.then(response => response.clone());
120120
};
121+
// We don't expect to see any extra properties on fetch but if there are any,
122+
// copy them over. Useful for extended fetch environments or mocks.
123+
Object.assign(fetch, originalFetch);
121124
} catch (error) {
122125
// Log even in production just to make sure this is seen if only prod is frozen.
123126
// eslint-disable-next-line react-internal/no-production-logging

0 commit comments

Comments
 (0)