Skip to content

Commit 935848d

Browse files
committed
Revert fetch instrumentation to only RSC
1 parent 0c11baa commit 935848d

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/react/src/React.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,6 @@ import ReactSharedInternals from './ReactSharedInternals';
7171
import {startTransition} from './ReactStartTransition';
7272
import {act} from './ReactAct';
7373

74-
// Patch fetch
75-
import './ReactFetch';
76-
7774
// TODO: Move this branching into the other module instead and just re-export.
7875
const createElement: any = __DEV__
7976
? createElementWithValidation

packages/react/src/ReactSharedSubset.experimental.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
* @flow
88
*/
99

10+
// Patch fetch
11+
import './ReactFetch';
12+
1013
export {
1114
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
1215
Children,

packages/react/src/__tests__/ReactFetch-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ describe('ReactFetch', () => {
4141
fetchCount = 0;
4242
global.fetch = fetchMock;
4343

44+
if (gate(flags => flags.experimental && !flags.www)) {
45+
jest.mock('react', () => require('react/react.shared-subset'));
46+
}
4447
React = require('react');
4548
ReactServerDOMServer = require('react-server-dom-webpack/server.browser');
4649
ReactServerDOMClient = require('react-server-dom-webpack/client');

0 commit comments

Comments
 (0)