diff --git a/src/__tests__/native/className-with-style.test.tsx b/src/__tests__/native/className-with-style.test.tsx index c27875fc..ea9af8ed 100644 --- a/src/__tests__/native/className-with-style.test.tsx +++ b/src/__tests__/native/className-with-style.test.tsx @@ -99,6 +99,21 @@ test("View with multiple className properties where inline style takes precedenc ]); }); +test("FlatList: className should map to style", () => { + registerCSS(`.bg-red { background-color: red; }`); + + const component = render( + null} + className="bg-red" + />, + ).getByTestId(testID); + + expect(component.props.style).toStrictEqual({ backgroundColor: "#f00" }); +}); + /** * Tests for style={undefined} not destroying computed className styles. * diff --git a/src/components/FlatList.tsx b/src/components/FlatList.tsx index aafb7aad..06fe3d29 100644 --- a/src/components/FlatList.tsx +++ b/src/components/FlatList.tsx @@ -10,6 +10,7 @@ import { import { copyComponentProperties } from "./copyComponentProperties"; const mapping: StyledConfiguration = { + className: "style", ListFooterComponentClassName: "ListFooterComponentStyle", ListHeaderComponentClassName: "ListHeaderComponentStyle", columnWrapperClassName: "columnWrapperStyle",