fix: add missing style mapping on flatlist#321
Open
maxencehenneron wants to merge 3 commits intonativewind:mainfrom
Open
fix: add missing style mapping on flatlist#321maxencehenneron wants to merge 3 commits intonativewind:mainfrom
maxencehenneron wants to merge 3 commits intonativewind:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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"toFlatList’sStyledConfigurationmapping. - Add a Jest test asserting
FlatListclassNameresults in the expectedstyleprop.
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 className → style 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FlatListcomponent was missing theclassName→stylemapping in itsStyledConfiguration, meaningclassNameprops on<FlatList>were silently ignoredclassNamecorrectly applies stylesTest plan
FlatList: className should map to stylethat verifiesclassName="bg-red"produces the expectedbackgroundColorstyleyarn testto confirm all tests pass