Skip to content

Commit 65ea205

Browse files
authored
Rename user hook (#1347)
Co-authored-by: Chase Fleming <[email protected]>
1 parent 221d845 commit 65ea205

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/build/getting-started/fcl-quickstart.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ However:
285285

286286
### Integrating Authentication and Building the Complete UI
287287

288-
Finally, integrate the query, mutation, and transaction status hooks with authentication using `useCurrentFlowUser`. Combine all parts to build the complete page.
288+
Finally, integrate the query, mutation, and transaction status hooks with authentication using `useFlowCurrentUser`. Combine all parts to build the complete page.
289289

290290
```tsx
291291
"use client";
@@ -295,11 +295,11 @@ import {
295295
useFlowQuery,
296296
useFlowMutate,
297297
useFlowTransactionStatus,
298-
useCurrentFlowUser,
298+
useFlowCurrentUser,
299299
} from "@onflow/kit";
300300

301301
export default function Home() {
302-
const { user, authenticate, unauthenticate } = useCurrentFlowUser();
302+
const { user, authenticate, unauthenticate } = useFlowCurrentUser();
303303

304304
const { data, isLoading, error, refetch } = useFlowQuery({
305305
cadence: `
@@ -409,7 +409,7 @@ In this complete page:
409409
- **Step 1** queries the counter value.
410410
- **Step 2** sends a transaction to increment the counter and stores the transaction ID.
411411
- **Step 3** subscribes to transaction status updates using the stored transaction ID and uses a `useEffect` hook to automatically refetch the updated count when the transaction is sealed (status code 4).
412-
- **Step 4** integrates authentication via `useCurrentFlowUser` and combines all the pieces into a single user interface.
412+
- **Step 4** integrates authentication via `useFlowCurrentUser` and combines all the pieces into a single user interface.
413413

414414
:::tip
415415

@@ -451,7 +451,7 @@ Then visit [http://localhost:3000](http://localhost:3000) in your browser. You s
451451
By following these steps, you've built a simple Next.js dApp that interacts with a Flow smart contract using [**@onflow/kit**]. In this guide you learned how to:
452452

453453
- Wrap your application in a `FlowProvider` to configure blockchain connectivity.
454-
- Use kit hooks such as `useFlowQuery`, `useFlowMutate`, `useFlowTransactionStatus`, and `useCurrentFlowUser` to manage authentication, query on-chain data, submit transactions, and monitor their status.
454+
- Use kit hooks such as `useFlowQuery`, `useFlowMutate`, `useFlowTransactionStatus`, and `useFlowCurrentUser` to manage authentication, query on-chain data, submit transactions, and monitor their status.
455455
- Integrate with the local Flow emulator and Dev Wallet for a fully functional development setup.
456456

457457
For additional details and advanced usage, refer to the [@onflow/kit documentation] and other Flow developer resources.

docs/tools/kit/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ sidebar_position: 1
1010

1111
## 🔌 Included React Hooks
1212

13-
- [`useCurrentFlowUser`](#usecurrentflowuser) – Authenticate and manage the current Flow user
13+
- [`useFlowCurrentUser`](#useflowcurrentuser) – Authenticate and manage the current Flow user
1414
- [`useFlowAccount`](#useflowaccount) – Fetch Flow account details by address
1515
- [`useFlowBlock`](#useflowblock) – Query latest or specific Flow blocks
1616
- [`useFlowChainId`](#useflowchainid) – Retrieve the current Flow chain ID
@@ -83,10 +83,10 @@ Many of these hooks are built using [`@tanstack/react-query`](https://tanstack.c
8383

8484
:::
8585

86-
### `useCurrentFlowUser`
86+
### `useFlowCurrentUser`
8787

8888
```tsx
89-
import { useCurrentFlowUser } from "@onflow/kit"
89+
import { useFlowCurrentUser } from "@onflow/kit"
9090
```
9191

9292
#### Returns:
@@ -97,7 +97,7 @@ import { useCurrentFlowUser } from "@onflow/kit"
9797

9898
```tsx
9999
function AuthComponent() {
100-
const { user, authenticate, unauthenticate } = useCurrentFlowUser()
100+
const { user, authenticate, unauthenticate } = useFlowCurrentUser()
101101

102102
return (
103103
<div>

0 commit comments

Comments
 (0)