Please, add `contentContainerStyle` gap style support
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 393
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 1
Description
Problem Statement
Can we have a way to adjust the spacing between items? At the moment, contentContainerStyle allows us to only adjust the padding and background color.
Proposed Solution
It would be helpful to have the ability to customize the layout in the recycler code.
Example Usage
<FlashList gap={20} />
Alternatives Considered
I can create some invisible gaps between items using ItemSeparatorComponent={renderGap}, or I can adjust the margins of each item.
Priority
- Critical - Blocking my project
- High - Significant improvement to my workflow
- Medium - Would be nice to have
- Low - Minor enhancement
Additional Context
Currently, this breaks the promise of a "drop-in replacement for FlatList", as FlashList does not support all the styling options available in React Native.
By the way, the TS misleads users by resolving styles as a full set of styles. Without referring to the documentation, it is difficult to determine what is going wrong and why.
Checklist
- I've searched existing issues and discussions
- I've provided clear use cases for this feature
- I'm willing to help test this feature if implemented
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how FlashList handles contentContainerStyle and how the recycler code lays out items. Compare the requested gap behavior with the existing ItemSeparatorComponent workaround and the proposed API. Done means spacing can be configured as requested, existing padding and background styling still work, and the supported TypeScript styling surface is accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100