Skip to content

Commit ced712f

Browse files
authored
Merge pull request #2808 from gluestack/patch
Patch
2 parents 9641c72 + 1d6b7c7 commit ced712f

File tree

1 file changed

+2
-2
lines changed
  • example/storybook-nativewind/src/core-components/nativewind/grid

1 file changed

+2
-2
lines changed

example/storybook-nativewind/src/core-components/nativewind/grid/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const Grid = forwardRef<React.ComponentRef<typeof View>, IGridProps>(
165165

166166
const childrenWithProps = React.Children.map(children, (child, index) => {
167167
if (React.isValidElement(child)) {
168-
return React.cloneElement(child, { key: index });
168+
return React.cloneElement(child, { key: index, index: index } as any);
169169
}
170170

171171
return child;
@@ -205,7 +205,7 @@ const Grid = forwardRef<React.ComponentRef<typeof View>, IGridProps>(
205205
props?.paddingEnd || props?.paddingRight || props?.padding || 0;
206206

207207
const gridWidth =
208-
event.nativeEvent.layout.width -
208+
Math.floor(event.nativeEvent.layout.width) -
209209
paddingLeftToSubtract -
210210
paddingRightToSubtract -
211211
borderWidthToSubtract;

0 commit comments

Comments
 (0)