Skip to content

Commit

Permalink
Add extra fetch properties if there were any
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Oct 19, 2022
1 parent 3ea86d0 commit c94f72d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react/src/ReactFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ if (enableCache && enableFetchInstrumentation) {
// of the body so that it can be read multiple times.
return match.then(response => response.clone());
};
// We don't expect to see any extra properties on fetch but if there are any,
// copy them over. Useful for extended fetch environments or mocks.
Object.assign(fetch, originalFetch);
} catch (error) {
// Log even in production just to make sure this is seen if only prod is frozen.
// eslint-disable-next-line react-internal/no-production-logging
Expand Down

0 comments on commit c94f72d

Please sign in to comment.