Skip to content

Commit

Permalink
Merge pull request #438 from appwrite/fix-react-tutorial
Browse files Browse the repository at this point in the history
Fix React tutorial create account
  • Loading branch information
Vincent (Wen Yu) Ge authored Jan 16, 2024
2 parents cfe03fa + 92a71f1 commit 9dc4ef5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/docs/tutorials/react/step-4/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ We'll use context and a custom hook to manage our user's data.
Create a new file `src/lib/context/user.jsx` and add the following code to it.

```js
import { ID } from "appwrite";
import { createContext, useContext, useEffect, useState } from "react";
import { account } from "../appwrite";

Expand All @@ -36,7 +37,7 @@ export function UserProvider(props) {
}

async function register(email, password) {
await account.create(email, password);
await account.create(ID.unique(), email, password);
await login(email, password);
}

Expand Down

0 comments on commit 9dc4ef5

Please sign in to comment.