mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-02 10:35:54 +00:00
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
[![Build Status][travis-image]][travis-url]
|
[![Build Status][travis-image]][travis-url]
|
||||||
[![npm version][npm-image]][npm-url]
|
[![npm version][npm-image]][npm-url]
|
||||||

|

|
||||||
|
|
||||||
[React Native][react-native-url] components and APIs for the Web.
|
[React Native][react-native-url] components and APIs for the Web.
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ import React, { Component } from 'react'
|
|||||||
import ScrollView from '../ScrollView'
|
import ScrollView from '../ScrollView'
|
||||||
import ListViewDataSource from './ListViewDataSource'
|
import ListViewDataSource from './ListViewDataSource'
|
||||||
import ListViewPropTypes from './ListViewPropTypes'
|
import ListViewPropTypes from './ListViewPropTypes'
|
||||||
|
import View from '../View'
|
||||||
|
import pick from 'lodash/pick'
|
||||||
|
|
||||||
const SCROLLVIEW_REF = 'listviewscroll'
|
const SCROLLVIEW_REF = 'listviewscroll'
|
||||||
|
|
||||||
@@ -64,7 +66,7 @@ class ListView extends Component {
|
|||||||
if (renderSectionHeader) {
|
if (renderSectionHeader) {
|
||||||
const section = dataSource.getSectionHeaderData(sectionIdx)
|
const section = dataSource.getSectionHeaderData(sectionIdx)
|
||||||
const key = 's_' + sectionId
|
const key = 's_' + sectionId
|
||||||
const child = <div key={key}>{renderSectionHeader(section, sectionId)}</div>
|
const child = <View key={key}>{renderSectionHeader(section, sectionId)}</View>
|
||||||
children.push(child)
|
children.push(child)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +75,7 @@ class ListView extends Component {
|
|||||||
const rowId = rows[rowIdx]
|
const rowId = rows[rowIdx]
|
||||||
const row = dataSource.getRowData(sectionIdx, rowIdx)
|
const row = dataSource.getRowData(sectionIdx, rowIdx)
|
||||||
const key = 'r_' + sectionId + '_' + rowId
|
const key = 'r_' + sectionId + '_' + rowId
|
||||||
const child = <div key={key}>{renderRow(row, sectionId, rowId, this.onRowHighlighted)}</div>
|
const child = <View key={key}>{renderRow(row, sectionId, rowId, this.onRowHighlighted)}</View>
|
||||||
children.push(child)
|
children.push(child)
|
||||||
|
|
||||||
// render optional separator
|
// render optional separator
|
||||||
@@ -88,12 +90,9 @@ class ListView extends Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const {
|
const props = pick(ScrollView.propTypes, this.props)
|
||||||
renderScrollComponent,
|
|
||||||
...props
|
|
||||||
} = this.props
|
|
||||||
|
|
||||||
return React.cloneElement(renderScrollComponent(props), {
|
return React.cloneElement(this.props.renderScrollComponent(props), {
|
||||||
ref: SCROLLVIEW_REF
|
ref: SCROLLVIEW_REF
|
||||||
}, header, children, footer)
|
}, header, children, footer)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user