docs: fix duplicate code block syntax in example sections#357
docs: fix duplicate code block syntax in example sections#357
Conversation
|
Hi! I'm the It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃 |
There was a problem hiding this comment.
Pull request overview
This PR fixes malformed markdown fences in hook documentation examples so code samples render correctly (removing duplicated/open-ended code blocks and correcting a language tag typo).
Changes:
- Remove duplicate code fence openers (````tsx + ```tsx) and orphaned empty code blocks in affected docs.
- Normalize example code blocks to a single valid
```tsxfence. - Fix the
tsxptypo totsxinuseNetworkStatus.md.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/hooks/useMap/useMap.md | Removes duplicate/orphaned code fences around the example. |
| packages/mobile/src/hooks/useBodyScrollLock/useBodyScrollLock.md | Removes duplicate/orphaned code fences around the example. |
| packages/mobile/src/hooks/useNetworkStatus/useNetworkStatus.md | Fixes tsxp → tsx and removes duplicate/orphaned code fences. |
| packages/mobile/src/hooks/usePageVisibility/usePageVisibility.md | Removes duplicate/orphaned code fences around the example. |
| packages/mobile/src/hooks/useScrollDirection/useScrollDirection.md | Removes duplicate/orphaned code fences around the example (also reveals an existing Interface/signature mismatch noted in comments). |
Comments suppressed due to low confidence (1)
packages/mobile/src/hooks/useScrollDirection/useScrollDirection.md:33
- The example destructures
{ direction, position }, but the Interface section above currently declaresfunction useScrollDirection(): void;and doesn’t show theoptionsparameter. This makes the docs inconsistent with the actual hook API (it returns a state object and acceptsoptions.throttleMs). Please update the Interface signature to match the implementation/usage so generated docs don’t mislead consumers.
function Header() {
const { direction, position } = useScrollDirection();
// Hide header on scroll down
const isHidden = direction === 'down' && position > 100;
0e5592c to
52fb202
Compare
Summary
tsxptypo inuseNetworkStatus.mdAffected files
packages/core/src/hooks/useMap/useMap.mdpackages/mobile/src/hooks/useBodyScrollLock/useBodyScrollLock.mdpackages/mobile/src/hooks/useNetworkStatus/useNetworkStatus.mdpackages/mobile/src/hooks/usePageVisibility/usePageVisibility.mdpackages/mobile/src/hooks/useScrollDirection/useScrollDirection.mdBefore / After
Test plan