docs: correct viewport hook and box defaults#78
Conversation
Co-Authored-By: Mark <psyhik17@gmail.com> Co-Authored-By: Codex <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91bc52b9fc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | `flexDirection` | `'row' \| 'column' \| 'row-reverse' \| 'column-reverse'` | `'row'` | `<Box>` default; pass `'column'` for stacked rows | | ||
| | `flexGrow` | `number` | `0` | | | ||
| | `flexShrink` | `number` | `0` | **Differs from CSS / Ink (which default to 1).** Pass `1` to enable shrinking | | ||
| | `flexShrink` | `number` | `1` | `<Box>` default matches CSS / Ink. Pass `0` for chrome that must not collapse | |
There was a problem hiding this comment.
Propagate the flexShrink default change
This table now says the public <Box> default is flexShrink={1}, but the repo still tells users the opposite in docs/faq.md lines 11 and 35-36 and docs/troubleshooting.md line 19, including advice to set flexShrink={1} to fix overflow. Because those pages link users back to the styles reference, the documentation now gives contradictory debugging and migration guidance; please update or explicitly scope the remaining Yoga-port statements in the same change.
Useful? React with 👍 / 👎.
| | `useStdin()` | Stdin stream + `isRawModeSupported` | | ||
| | `useStdout()` | Stdout stream + `write` | | ||
| | `useTerminalViewport()` | `{ columns, rows }`, updates on resize | | ||
| | `useTerminalViewport()` | `[ref, entry]`, where `entry.isVisible` tracks whether the referenced element is currently in the terminal viewport | |
There was a problem hiding this comment.
Update the remaining resize guidance
The README correction makes clear that useTerminalViewport() returns a visibility ref/entry rather than terminal dimensions, but docs/faq.md line 88 and docs/reference/events.md line 210 still direct users handling SIGWINCH/terminal resize to read it reactively. In that resize scenario the hook has no columns/rows return and visibility changes do not trigger rerenders on their own, so the stale guidance will send users to the wrong API; please update those resize docs alongside this hook table.
Useful? React with 👍 / 👎.
Co-Authored-By: Mark <psyhik17@gmail.com> Co-Authored-By: Codex <noreply@anthropic.com>
Summary
Closes #65.
Closes #66.
Verification