Skip to content

Commit dd48ac4

Browse files
Fix error thrown by useRequestData hook
1 parent ca173eb commit dd48ac4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hooks/use-request-data/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import isObject from 'lodash/isObject';
99
*/
1010
import { store as coreStore } from '@wordpress/core-data';
1111
// @ts-ignore-next-line - The type definitions for the data package are incomplete.
12-
import { useSelect, useDispatch, store as dataStore } from '@wordpress/data';
12+
import { useSelect, useDispatch } from '@wordpress/data';
1313

1414
/**
1515
* Hook for retrieving data from the WordPress REST API.
@@ -27,7 +27,7 @@ export const useRequestData = (entity: string, kind: string, query: Record<strin
2727
return {
2828
// @ts-ignore-next-line - The type definitions for the data package are incomplete.
2929
data: select(coreStore)[functionToCall](entity, kind, query),
30-
isLoading: select(dataStore).isResolving(coreStore, functionToCall, [
30+
isLoading: select('core/data').isResolving(coreStore, functionToCall, [
3131
entity,
3232
kind,
3333
query,

0 commit comments

Comments
 (0)