Skip to content

Commit d04c669

Browse files
author
Li Yongyu
committed
fix(Error): fix Undefined is not an object (evaluating 'this.viewProperties.width')
1 parent 7d54382 commit d04c669

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/FlatListItem.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ export default class FlatListItem extends React.PureComponent {
1414
super(props);
1515
this.state = {
1616
visibility: true,
17-
}
18-
}
19-
20-
onLayout(evt) {
17+
};
2118
this.viewProperties = {
2219
width: 0,
2320
height: 0,
24-
}
21+
};
22+
}
23+
24+
onLayout(evt) {
2525
this.viewProperties.width = evt.nativeEvent.layout.width;
2626
this.viewProperties.height = evt.nativeEvent.layout.height;
2727
}

0 commit comments

Comments
 (0)