From e048e06527b6965e2bc031dbbb44db410753276e Mon Sep 17 00:00:00 2001 From: Tom Gasson Date: Tue, 27 Sep 2022 13:35:35 +1000 Subject: [PATCH] [react-relay]: Export ProfilerContext To match https://github.com/facebook/relay/pull/4049 --- types/react-relay/hooks.d.ts | 3 +++ types/react-relay/test/react-relay-tests.tsx | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/types/react-relay/hooks.d.ts b/types/react-relay/hooks.d.ts index 3a8e3be96b7d34b..02f673f42b1f1c1 100644 --- a/types/react-relay/hooks.d.ts +++ b/types/react-relay/hooks.d.ts @@ -62,6 +62,8 @@ export { requestSubscription } from 'relay-runtime'; export { RelayEnvironmentProvider } from './relay-hooks/RelayEnvironmentProvider.react'; export { EntryPointContainer } from './relay-hooks/EntryPointContainer.react'; +export { ProfilerContext } from './relay-hooks/ProfilerContext'; + export { fetchQuery } from 'relay-runtime'; export { loadQuery } from './relay-hooks/loadQuery'; @@ -79,3 +81,4 @@ export { useRelayEnvironment } from './relay-hooks/useRelayEnvironment'; export { useSubscribeToInvalidationState } from './relay-hooks/useSubscribeToInvalidationState'; export { useSubscription } from './relay-hooks/useSubscription'; export { useClientQuery } from './relay-hooks/useClientQuery'; + diff --git a/types/react-relay/test/react-relay-tests.tsx b/types/react-relay/test/react-relay-tests.tsx index 96f70599d0babfa..3d400aed10b78cd 100644 --- a/types/react-relay/test/react-relay-tests.tsx +++ b/types/react-relay/test/react-relay-tests.tsx @@ -26,6 +26,7 @@ import { RelayProp, RelayRefetchProp, requestSubscription, + ProfilerContext, } from 'react-relay'; // ~~~~~~~~~~~~~~~~~~~~~ @@ -759,3 +760,14 @@ const MyRelayContextConsumer: React.FunctionComponent = () => { /> ); }; + +const MyRelayProfilerContextProvider: React.FunctionComponent = () => { + const context = React.useMemo(() => ({ + wrapPrepareQueryResource(cb: () => T) { + return cb(); + } + }), []); + return ( +
+ ); +};