Docs: Wrong syntax in example @ technical-reference useViewCast

Open Beginner friendly
#281 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
documentation

Research direction

Open docs/mini-apps/technical-reference/minikit/hooks/useViewCast.mdx and compare the useViewCast example with the proposed syntax in the issue. Verify the corrected snippet against the hook's documented API, then update the example so it is valid and confirm the rendered documentation shows the working usage.

Written by the indexing model from the issue text.

Description

Hi there!
I've just found a non-working snippet, here's a proposed fix too.

  • Issue: Wrong syntax in the useViewCast hook code example

Current implementation:

const viewSharedCast = useViewCast(sharedCastHash);
// ...
        {sharedCastHash && (
          <button onClick={viewSharedCast}>
            View My Share
          </button>
        )}

Expected:

const { viewCast } = useViewCast();

const viewSharedCast = () => {
        if (sharedCastHash) {
            viewCast({
                hash: sharedCastHash,
                close: false
            });
        }
    };

// ...
        {sharedCastHash && (
          <button onClick={viewSharedCast}>
            View My Share
          </button>
        )}
Dominant language
JavaScript
Stars
337
Forks
798
Avg merge
7h 24m
Merged PRs (30d)
51

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from base/docs

All issues in base/docs

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.