@fruits-chain/react-native-xiaoshu
Version:
React Native UI library
35 lines (32 loc) • 768 B
JavaScript
import React, { useMemo, memo } from 'react';
import { View } from 'react-native';
import RowContext from './context';
import STYLES from './style';
/**
* Row 布局
* @description 一组单元格。
*/
const Row = _ref => {
let {
children,
gutter = 0,
style
} = _ref;
const ctx = useMemo(() => ({
gutter
}), [gutter]);
const rowStyles = [STYLES.row, {
marginHorizontal: -(+gutter / 2)
}, style // to test ui
// {
// backgroundColor: '#666',
// },
]; // console.log(-(+gutter / 2));
return /*#__PURE__*/React.createElement(RowContext.Provider, {
value: ctx
}, /*#__PURE__*/React.createElement(View, {
style: rowStyles
}, children));
};
export default /*#__PURE__*/memo(Row);
//# sourceMappingURL=row.js.map