File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,21 @@ test("View with multiple className properties where inline style takes precedenc
9999 ] ) ;
100100} ) ;
101101
102+ test ( "FlatList: className should map to style" , ( ) => {
103+ registerCSS ( `.bg-red { background-color: red; }` ) ;
104+
105+ const component = render (
106+ < FlatList
107+ testID = { testID }
108+ data = { [ ] }
109+ renderItem = { ( ) => null }
110+ className = "bg-red"
111+ /> ,
112+ ) . getByTestId ( testID ) ;
113+
114+ expect ( component . props . style ) . toStrictEqual ( { backgroundColor : "#f00" } ) ;
115+ } ) ;
116+
102117/**
103118 * Tests for style={undefined} not destroying computed className styles.
104119 *
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010import { copyComponentProperties } from "./copyComponentProperties" ;
1111
1212const mapping : StyledConfiguration < typeof RNFlatList > = {
13+ className : "style" ,
1314 ListFooterComponentClassName : "ListFooterComponentStyle" ,
1415 ListHeaderComponentClassName : "ListHeaderComponentStyle" ,
1516 columnWrapperClassName : "columnWrapperStyle" ,
You can’t perform that action at this time.
0 commit comments