-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Problem
The last rendered block always keeps a bottom margin (e.g., 4px), so StreamdownRN leaves extra space at the end even when the container has no padding. This is especially visible with short content or list-only messages.
Where it comes from
- Paragraphs/headings apply
marginBottom: theme.spacing.blockin src/themes/index.ts. - Several block containers also use
marginBottom: theme.spacing.blockin src/themes/index.ts. - List rows hard-code
marginBottom: 4in src/renderers/ASTRenderer.tsx.
Steps to reproduce
- Render a single paragraph or list with
StreamdownRN. - Set
theme.spacing.blockto a small value (e.g., 4). - Observe extra spacing after the last block.
Example:
<StreamdownRN
theme={{
colors: { /* … */ },
fonts: { /* … */ },
spacing: { block: 4, inline: 4, indent: 16 }
}}
isComplete
>
{'Hello world'}
</StreamdownRN>Expected
No trailing bottom margin on the final rendered block.
Actual
A bottom margin equal to theme.spacing.block (and 4px for last list item) remains.
Environment
- streamdown-rn: ^0.2.1
- React Native / Expo (app-side)
Suggested fix
Add a way to drop spacing on the final block, e.g.: Pass isLastBlock from StreamdownRN to StableBlock / ActiveBlock. In ASTRenderer, conditionally set marginBottom: 0 when isLastBlock is true. Also set list row margin to index < last ? 4 : 0 in renderList.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels