mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-28 21:48:13 +08:00
fix(hippy-react): restore the ListView type props be number (#367)
Restore the https://github.com/Tencent/Hippy/commit/9de74e331b797c2137b1d0e3d08cd0dde0ee821a#diff-ccaf44058906717491bd079958ea5684a93acaa5d726e22cb34c0a6c82c79ffc
This commit is contained in:
@@ -6,7 +6,6 @@ import PullHeader from './pull-header';
|
||||
import PullFooter from './pull-footer';
|
||||
import { callUIFunction } from '../modules/ui-manager-module';
|
||||
import { warn } from '../utils';
|
||||
import { Device } from '../native';
|
||||
|
||||
type DataItem = any;
|
||||
|
||||
@@ -366,17 +365,11 @@ class ListView extends React.Component<ListViewProps, ListViewState> {
|
||||
}
|
||||
|
||||
if (typeof getRowType === 'function') {
|
||||
let type = getRowType(index);
|
||||
if (type) {
|
||||
if (typeof type !== 'string') {
|
||||
type = (type as any).toString();
|
||||
}
|
||||
if (Device.platform.OS === 'android') {
|
||||
itemProps.itemViewType = type;
|
||||
} else {
|
||||
itemProps.type = type;
|
||||
}
|
||||
const type = getRowType(index);
|
||||
if (!Number.isInteger(type)) {
|
||||
warn('getRowType must returns a number');
|
||||
}
|
||||
itemProps.type = type;
|
||||
}
|
||||
|
||||
if (typeof rowShouldSticky === 'function') {
|
||||
|
||||
Reference in New Issue
Block a user