Last active
January 24, 2025 07:56
-
-
Save harshq/2dfbf6786f4e11e91fd309c90c8fd792 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client" | |
import React, { use } from 'react' | |
const UseApiClientComponent: React.FC<{ data: any }> = ({ data }) => { | |
// we pass the promise to use. | |
const response = use(data) | |
// and we get data. | |
return <pre>{JSON.stringify(response, undefined, 2)}</pre> | |
} | |
export default UseApiClientComponent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment