File tree 2 files changed +4
-6
lines changed
packages/peregrine/lib/talons/Link
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ const givenEmptyProps = () => {
76
76
77
77
const givenValidProps = ( ) => {
78
78
props = {
79
- prefetchType : true ,
79
+ shouldPrefetch : true ,
80
80
innerRef : { current : 'foo' } ,
81
81
to : '/bar.html'
82
82
} ;
@@ -86,7 +86,7 @@ const givenFalsePrefetch = () => {
86
86
givenValidProps ( ) ;
87
87
props = {
88
88
...props ,
89
- prefetchType : false
89
+ shouldPrefetch : false
90
90
} ;
91
91
} ;
92
92
@@ -175,7 +175,7 @@ describe('#useLink does not run query when', () => {
175
175
expect ( mockRunQuery ) . not . toHaveBeenCalled ( ) ;
176
176
} ) ;
177
177
178
- test ( 'should prefetch is false' , async ( ) => {
178
+ test ( 'prefetch flag is false' , async ( ) => {
179
179
givenFalsePrefetch ( ) ;
180
180
181
181
await act ( ( ) => {
Original file line number Diff line number Diff line change @@ -8,9 +8,7 @@ import DEFAULT_OPERATIONS from '../MagentoRoute/magentoRoute.gql';
8
8
export const useLink = ( props , passedOperations = { } ) => {
9
9
const { innerRef : originalRef , to } = props ;
10
10
const shouldPrefetch = props . prefetchType || props . shouldPrefetch ;
11
- const operations = shouldPrefetch
12
- ? mergeOperations ( DEFAULT_OPERATIONS , passedOperations )
13
- : { } ;
11
+ const operations = mergeOperations ( DEFAULT_OPERATIONS , passedOperations ) ;
14
12
15
13
const intersectionObserver = useIntersectionObserver ( ) ;
16
14
const { resolveUrlQuery } = operations ;
You can’t perform that action at this time.
0 commit comments