Skip to content

Commit 2eb141b

Browse files
author
Javier Morant
authored
Create a default view for creating nested row easily (#19)
* Created an NestedRow component * Fix issue with NestedRow * Updated snapshot tests * Updated tests with NestedRow
1 parent de44b47 commit 2eb141b

File tree

8 files changed

+464
-126
lines changed

8 files changed

+464
-126
lines changed

NodeView.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ export default class NodeView extends React.PureComponent<Props, State> {
4444
},
4545
})
4646

47-
this.props.onNodePressed(this.state.node)
47+
if (this.props.onNodePressed) {
48+
this.props.onNodePressed(this.state.node)
49+
}
4850
}
4951

5052
renderChildren = (item: Node, level: number) => {
@@ -70,7 +72,9 @@ export default class NodeView extends React.PureComponent<Props, State> {
7072
<View>
7173
{!this.state.node.hidden ? (
7274
<TouchableWithoutFeedback onPress={this.onNodePressed}>
73-
{this.props.renderNode(this.state.node, this.props.level)}
75+
<View>
76+
{this.props.renderNode(this.state.node, this.props.level)}
77+
</View>
7478
</TouchableWithoutFeedback>
7579
) : null}
7680
{this.state.node.opened && rootChildren ? (

0 commit comments

Comments
 (0)