import React, { useMemo, memo, useState, useCallback } from 'react'; import type { ViewStyle, StyleProp, LayoutChangeEvent } from 'react-native'; import { View } from 'react-native'; import RowContext from './context'; import type { RowProps } from './interface'; import STYLES from './style'; /** * Row 布局 * @description 一组单元格。 */ const Row: React.FC = ({ gap = 0, style, justify, align, ...restProps }) => { const ctx = useMemo(() => ({ gap }), [gap]); const rowStyles: StyleProp = [ STYLES.row, { marginHorizontal: -(+gap / 2), justifyContent: justify, alignItems: align, }, style, // to test ui // { // backgroundColor: '#666', // }, ]; // console.log(-(+gutter / 2)); return ( ); }; interface AdaptiveRowProps extends RowProps {} /** * 自适应宽度的 Row 组件 * 使用 onLayout 自动获取容器宽度,解决嵌套 Popup 中宽度为 0 的问题 * * @example * * *