Skip to content

Commit

Permalink
Fixed oneOfType and fast-rendering issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hnryjms committed Dec 28, 2017
1 parent 1bd104f commit b89bcf5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions RNTableView/RNTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,11 @@ -(BOOL)hasCustomCells:(NSInteger)section {
#pragma mark - Scrolling

-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (!self.onScroll) {
// When rendering, `self.tableView.delegate` may be set before `onScroll` is passed in.
return;
}

self.onScroll(@{
@"target": self.reactTag,
@"contentOffset": @{
Expand Down
2 changes: 1 addition & 1 deletion src/TableView.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TableView extends React.Component {
onAccessoryPress: PropTypes.func,
onWillDisplayCell: PropTypes.func,
onEndDisplayingCell: PropTypes.func,
selectedValue: PropTypes.oneOf([PropTypes.string, PropTypes.number]), // string or integer basically
selectedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), // string or integer basically
autoFocus: PropTypes.bool,
autoFocusAnimate: PropTypes.bool,
alwaysBounceVertical: PropTypes.bool,
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ interface TableViewProps {
showsHorizontalScrollIndicator?: boolean
showsVerticalScrollIndicator?: boolean
moveWithinSectionOnly?: boolean
selectedValue?: any
selectedValue?: string | number
json?: string
filter?: string
contentInset?: EdgeInsetsPropType
Expand Down

0 comments on commit b89bcf5

Please sign in to comment.