Skip to content

Commit 17b5c40

Browse files
committed
changing react hook name
1 parent c86a4ff commit 17b5c40

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

overlay.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ actions:
3535
- target: $["paths"]["/v1/code_sample"]["get"]
3636
update:
3737
x-speakeasy-group: codeSamples
38+
x-speakeasy-react-hook:
39+
name: CodeSamples

src/react-components/code-sample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import {
3-
useCodeSamplesGet,
4-
type CodeSamplesGetQueryData,
3+
useCodeSamples,
4+
type CodeSamplesQueryData,
55
type QueryHookOptions,
66
} from "../react-query/index.js";
77
import {
@@ -26,7 +26,7 @@ type CodeSampleProps = {
2626
language: CodeSampleLanguage;
2727

2828
/** The options for the TanStack query that fetches the code snippet. */
29-
queryOptions?: QueryHookOptions<CodeSamplesGetQueryData>;
29+
queryOptions?: QueryHookOptions<CodeSamplesQueryData>;
3030

3131
/** The component to render if there is an error fetching the code sample. */
3232
error?: (err: Error) => React.ReactNode;
@@ -84,7 +84,7 @@ export const CodeSample: React.FC<CodeSampleProps> = (props) => {
8484
...restProps
8585
} = props;
8686

87-
const { isPending, isError, error, data } = useCodeSamplesGet(
87+
const { isPending, isError, error, data } = useCodeSamples(
8888
{
8989
registryUrl: registryUrl,
9090
operationIds: [operationId],

0 commit comments

Comments
 (0)