Docs: Wrong syntax in example @ technical-reference useViewCast
- Dominant language
- JavaScript
- Stars
- 337
- Forks
- 792
- Avg merge
- 17h 23m
- Merged PRs (30d)
- 49
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:
```typescript
const viewSharedCast = useViewCast(sharedCastHash);
// ...
{sharedCastHash && (
View My Share
)}
```
Expected:
```typescript
const { viewCast } = useViewCast();
const viewSharedCast = () => {
if (sharedCastHash) {
viewCast({
hash: sharedCastHash,
close: false
});
}
};
// ...
{sharedCastHash && (
View My Share
)}
```
- Location: [mini-apps/technical-reference/minikit/hooks/useViewCast](https://github.com/base/docs/blob/0e0950e542a4de37959f4699d00ecc338fe6947d/docs/mini-apps/technical-reference/minikit/hooks/useViewCast.mdx)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.