Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 3b430d3

Browse files
committed
set column style to row
1 parent 93c70db commit 3b430d3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
ScrollViewProps,
55
View,
66
StyleProp,
7-
ViewStyle
7+
ViewStyle,
8+
StyleSheet
89
} from "react-native";
910

1011
export interface RNMasonryScrollViewProps extends ScrollViewProps {
@@ -39,7 +40,7 @@ const RNMasonryScrollView = ({
3940
const masonryGrid = generateMasonryGrid(children, columns);
4041

4142
return (
42-
<ScrollView {...otherProps}>
43+
<ScrollView contentContainerStyle={styles.columnStyle} {...otherProps}>
4344
{masonryGrid.map((column, columnIndex) => {
4445
return (
4546
<View
@@ -57,4 +58,8 @@ const RNMasonryScrollView = ({
5758
);
5859
};
5960

61+
const styles = StyleSheet.create({
62+
columnStyle: { flexDirection: "row" }
63+
});
64+
6065
export default RNMasonryScrollView;

0 commit comments

Comments
 (0)