Skip to content

Commit

Permalink
feat(04-zkapp-ui-with-react.mdx): add defining state example
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria committed Sep 27, 2024
1 parent 5671528 commit 9236a2e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/zkapps/tutorials/04-zkapp-ui-with-react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,16 @@ The example project has a completed app. The `page.tsx` file is the entry file f

The web worker code resides in the `04-zkapp-browser-ui/ui/app/zkappWorker.ts` file. Here, you define the functions that will be executed in the worker thread.

#### Defining State

The state object holds references to the zkAppInstance, AddInstance, transactions, and other necessary components.
```ts ignore
const state = {
Add: null as null | typeof Add,
zkapp: null as null | Add,
transaction: null as null | Transaction,
};
```

### Environment configuration

Expand Down

0 comments on commit 9236a2e

Please sign in to comment.