We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0bb375 commit 28bb694Copy full SHA for 28bb694
Components/Widgets/List.js
@@ -30,11 +30,21 @@ export default class ListNB extends NativeBaseComponent {
30
return computeProps(this.props, defaultProps);
31
32
}
33
+
34
+ renderChildren() {
35
+ var childrenArray = React.Children.toArray(this.props.children);
36
37
+ var lastElement = _.last(childrenArray);
38
39
+ var modLastElement = React.cloneElement(lastElement, computeProps(lastElement.props, {last: true}));
40
41
+ return _.concat(_.slice(childrenArray, 0, childrenArray.length - 1), modLastElement);
42
+ }
43
44
render() {
45
return(
46
<View {...this.prepareRootProps()} >
- {this.props.children}
47
+ {this.renderChildren()}
48
</View>
49
);
50
0 commit comments