Skip to content

Commit a0d4595

Browse files
committed
Exported Node flow type
1 parent 97399a7 commit a0d4595

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

examples/StateChangeNodeExample.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
type Props,
1010
type State,
1111
} from 'react-native'
12-
import NestedListView from 'react-native-nested-listview'
12+
import NestedListView, {type Node} from 'react-native-nested-listview'
1313

1414
const generateXNumItems = (numItems, prefix) => {
1515
const items = []
@@ -60,7 +60,7 @@ const styles = StyleSheet.create({
6060
export default class ExampleApp extends React.Component<Props, State> {
6161
nestedListView: any
6262

63-
renderNode = (node: Object, level: number) => {
63+
renderNode = (node: Node, level: number) => {
6464
const paddingLeft = (level + 1) * 30
6565

6666
return (
@@ -75,9 +75,9 @@ export default class ExampleApp extends React.Component<Props, State> {
7575
)
7676
}
7777

78-
onNodePressed = (node: Object) => {}
78+
onNodePressed = (node: Node) => {}
7979

80-
getChildrenName = (node: Object) => {
80+
getChildrenName = (node: Node) => {
8181
if (node.name === 'Item level 1.2.2') {
8282
return 'children'
8383
}

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React from 'react'
44
import {FlatList, type Props, type State, Text, View} from 'react-native'
55
import NodeView, {type Node} from './NodeView'
66
import shortid from 'shortid'
7+
export type {Node}
78

89
export default class NestedListView extends React.PureComponent<Props, State> {
910
props: {

0 commit comments

Comments
 (0)