Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
davidiw authored and Zekun Wang committed Oct 13, 2023
1 parent 9956fed commit 2ec2bb5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,7 @@ function App (
The `account` object is `null` if there is no account connected; when an account is connected, the `account` object holds the account information, including the account address.

3. Next, we want to fetch the account’s TodoList resource.
Begin by importing `useEffect` by adding:

```jsx
import { useEffect } from "react";
```

Begin by importing `useEffect` by using `jsx import useEffect from "react"; `
Let’s add a `useEffect` hook to our file that would call a function to fetch the resource whenever our account address changes:

```jsx
Expand All @@ -75,17 +70,17 @@ function App() {
}
```
4. Before creating our `fetchList` function, let’s also create a local state to store whether the account has a list.
Import `useState` by using ```import { useState, useEffect } from "react"; ```
Next create a state variable `accountHasList` and its setter `setAccountHasList`
4. Before creating our `fetchList` function, let’s also create a local state to store whether the account has a list:
```jsx
```js
function App (
...
const [accountHasList, setAccountHasList] = useState<boolean>(false);
...
)
```
also import `useEffect` using
```import { useState, useEffect } from "react"; ```
5. Our `useEffect` hook is calling a `fetchList` function; let’s create it:
Expand Down
9 changes: 0 additions & 9 deletions developer-docs-site/scripts/additional_dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,6 @@ accessors
accountHasList
acount
addr
ae
af
ait
allowfullscreen
allowlist
Expand All @@ -353,7 +351,6 @@ aptoslabs
arity
arweave
asia
async
atomicity
auth
authenticator
Expand Down Expand Up @@ -402,7 +399,6 @@ dapp
dapp's
dapps
data's
dbab
de
deallocate
debuggability
Expand Down Expand Up @@ -437,7 +433,6 @@ enums
extensibility
failover
faq
fdaefc
fetchList
filesystem
findable
Expand All @@ -451,7 +446,6 @@ fungibility
gcloud
gcp
gcs
getAccountResource
getAddressByName
getPrimaryNameByAddress
groth
Expand Down Expand Up @@ -511,7 +505,6 @@ mempool
mempools
merkle
mintAptosName
moduleAddress
monorepo
multinode
multisig
Expand Down Expand Up @@ -605,7 +598,6 @@ subtyping
superset
svg
synchronizer
TodoListResource
terraform
testnet
th
Expand Down Expand Up @@ -657,7 +649,6 @@ waypoint
webapp
whitepaper
withdrawable
xcbddf
xFD
xlarge
yaml
Expand Down

0 comments on commit 2ec2bb5

Please sign in to comment.