-
-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
NestedListView declares the type of the onNodePressed prop as () => any
onNodePressed?: () => any |
This prop gets passed directly to NodeView which has an inconsistent signature: (item: any) => any
onNodePressed?: (item: any) => any |
Neither signature is accurate to the actual usage of the onNodePressed prop. The only time where the prop is actually used is this line:
react-native-nested-listview/src/NodeView.tsx
Lines 60 to 62 in a747449
if (this.props.onNodePressed) { | |
this.props.onNodePressed(this.state.node) | |
} |
And the type of this.state.node
is INode
:
react-native-nested-listview/src/NodeView.tsx
Lines 26 to 27 in a747449
export interface IState { | |
node: INode |
So the correct signature in all locations should be (node?: INode) => void
Metadata
Metadata
Assignees
Labels
No labels