Skip to main content

Function: useMyVote()

useMyVote(proposalId, userDid, options): UseQueryResult<null | VoteView, Error>

Defined in: web/lib/hooks/use-governance.ts:379

Fetches the current user's vote on a proposal.

Parameters​

proposalId​

string

Proposal ID

userDid​

string

User DID

options​

UseGovernanceOptions = {}

Hook options

Returns​

UseQueryResult<null | VoteView, Error>

Query result with user's vote or null

Example​

const { data: myVote } = useMyVote(proposalId, currentUser.did);