Open cixio opened 1 month ago
fixed bug
Hi @cixio, thanks for the PR. As you point out, this is just a workaround. The same issue happens with other props, like hideSeparator
, as you mention in #784 . From what you report, I don't see any hard requirement, why you would introduce another react component as layer in between Section
and Cell
. Therefor I suggest to follow this approach:
Is there anything that speaks against this approach from your point of view?
Hi, yes, I use this as workaround, but its also a new feature. :)
The soluton with the cellPropsCustom is a point, but thats also just a workaround as I think the best solution to use custom settings is this:
import { TableView as TV, Section as S, Cell as C, Separator as Sep } from 'react-native-tableview-simple';
const TableView = (props) => {
return (
<TV
appearance={'dark'}
style={ {marginHorizontal: 15} }
{...props}
/>
);
}
const Section = (props) => {
return (
<S
allowFontScaling={false}
hideSurroundingSeparators={true}
roundedCorners={true}
{...props}
/>
);
}
[...]
export {TableView, Section, Cell, Separator};
So you only have to include this file on every page:
import { TableView, Section, Cell, Separator } from './myTableView';
And you can use tableview on multiple page without adding custom settings on every line.
The problem is that using this way makes some issues like the separator backgroundcolor and hideSeparator.
adding separatorBackgroundColor to Section - this is a workaround for https://github.com/Purii/react-native-tableview-simple/issues/784