I'm using the react-native-nested-list-view library.I was able to construct a tree-view but by default the expand and collapse in the tree view is done on click of the entire row. But my requirement is to expand and collapse on the click of '>' and '\/' buttons respectively. library used: "react-native-nested-listview": "^0.8.0". Please help me with this issue.
renderNestedListView = (chapter) => {
return (
<NestedListView
data={chapter}
getChildrenName={(node) => 'section'}
onNodePressed={(node) => this.handleNodeClick(node)}
renderNode={(node, level) => (
<NestedRow
level={level}
style={{ borderColor: 'black', borderWidth: 0.5 }}
paddingLeftIncrement={20}
>
<Text>
{
node['chapterTitle'] === undefined ? readProdDescAndCreateView(node['sectionTitle'])
: node['chapterTitle']
}
{(node['section'] !== undefined
&& Object.values(node['section']).length !== 0) && this.getExpandOrCollapse(node)}
</Text>
</NestedRow>
)}
/>
)