Skip to content

fix: add missing style mapping on flatlist#321

Open
maxencehenneron wants to merge 3 commits intonativewind:mainfrom
maxencehenneron:flatlist-classname
Open

fix: add missing style mapping on flatlist#321
maxencehenneron wants to merge 3 commits intonativewind:mainfrom
maxencehenneron:flatlist-classname

Conversation

@maxencehenneron
Copy link
Copy Markdown

@maxencehenneron maxencehenneron commented Apr 7, 2026

Summary

  • The FlatList component was missing the classNamestyle mapping in its StyledConfiguration, meaning className props on <FlatList> were silently ignored
  • Added the missing mapping and a test to verify className correctly applies styles

Test plan

  • Added test FlatList: className should map to style that verifies className="bg-red" produces the expected backgroundColor style
  • Run yarn test to confirm all tests pass

Copilot AI review requested due to automatic review settings April 7, 2026 20:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a gap in the React Native CSS component wrappers where FlatList did not map className to the style prop, causing className on <FlatList> to be ignored. It adds the missing mapping and a regression test to ensure className produces the expected computed RN styles.

Changes:

  • Add className: "style" to FlatList’s StyledConfiguration mapping.
  • Add a Jest test asserting FlatList className results in the expected style prop.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/components/FlatList.tsx Adds the missing classNamestyle mapping so FlatList participates in the same styling behavior as other wrapped components.
src/tests/native/className-with-style.test.tsx Adds a regression test ensuring FlatList className computes and applies styles to style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants