Skip to content

Commit 3ee6018

Browse files
alunyovfacebook-github-bot
authored andcommitted
Inject useFragmentInternal to use in useLazyLoadQueryNode
Reviewed By: tyao1 Differential Revision: D50412998 fbshipit-source-id: 3548556eed34c1cb0315a10fae5ec94c6804d7c8
1 parent 3017057 commit 3ee6018

File tree

5 files changed

+962
-906
lines changed

5 files changed

+962
-906
lines changed

packages/react-relay/relay-hooks/HooksImplementation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
'use strict';
1313

14+
import typeof useFragmentInternal from './react-cache/useFragmentInternal_REACT_CACHE';
1415
import typeof useFragment from './useFragment';
1516
import type {UsePaginationFragmentType} from './usePaginationFragment';
1617
import type {UseRefetchableFragmentType} from './useRefetchableFragment';
@@ -21,13 +22,14 @@ type HooksImplementation = {
2122
useFragment: useFragment,
2223
usePaginationFragment: UsePaginationFragmentType,
2324
useRefetchableFragment: UseRefetchableFragmentType,
25+
useFragment__internal?: useFragmentInternal,
2426
};
2527

2628
let implementation: HooksImplementation | null = null;
2729

2830
function inject(impl: HooksImplementation): void {
2931
warning(
30-
implementation !== null,
32+
implementation === null,
3133
'Relay HooksImplementation was injected twice.',
3234
);
3335
implementation = impl;

packages/react-relay/relay-hooks/__tests__/useLazyLoadQueryNode-fast-refresh-test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
'use strict';
13+
1314
import type {RelayMockEnvironment} from '../../../relay-test-utils/RelayModernMockEnvironment';
1415
import type {
1516
OperationDescriptor,

0 commit comments

Comments
 (0)