-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
CellRendererComponent.tsx
32 lines (28 loc) · 1.12 KB
/
CellRendererComponent.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import React from 'react';
import type {StyleProp, ViewProps, ViewStyle} from 'react-native';
import {View} from 'react-native';
type CellRendererComponentProps = ViewProps & {
index: number;
style?: StyleProp<ViewStyle>;
};
function CellRendererComponent(props: CellRendererComponentProps) {
return (
<View
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
style={[
props.style,
/**
* To achieve absolute positioning and handle overflows for list items,
* it is necessary to assign zIndex values. In the case of inverted lists,
* the lower list items will have higher zIndex values compared to the upper
* list items. Consequently, lower list items can overflow the upper list items.
* See: https://github.com/Expensify/App/issues/20451
*/
{zIndex: -props.index, position: 'relative'},
]}
/>
);
}
CellRendererComponent.displayName = 'CellRendererComponent';
export default CellRendererComponent;