Skip to content

Commit 6c887b5

Browse files
committed
removed boilerplate code
1 parent 458ed70 commit 6c887b5

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

  • packages/react-native-ui-lib/src/components/screenFooter

packages/react-native-ui-lib/src/components/screenFooter/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,10 @@ const ScreenFooter = (props: ScreenFooterProps) => {
191191
}
192192

193193
if (itemsFit === ItemsFit.STRETCH && React.isValidElement(child)) {
194-
if (isHorizontal) {
195-
return (
196-
<View flex centerV key={index}>
197-
{React.cloneElement(child as React.ReactElement<any>, {center: true})}
198-
</View>
199-
);
200-
}
201-
return React.cloneElement(child as React.ReactElement<any>, {center: true});
194+
const centeredChild = React.cloneElement(child as React.ReactElement<any>, {center: true});
195+
return isHorizontal
196+
? <View flex centerV key={index}>{centeredChild}</View>
197+
: centeredChild;
202198
}
203199

204200
if (isHorizontal && itemsFit === ItemsFit.FIT) {

0 commit comments

Comments
 (0)