Compare commits

..

2 Commits

Author SHA1 Message Date
Nicolas Gallagher
21eeafabd5 0.0.38 2016-07-12 21:19:28 -07:00
Nicolas Gallagher
249f157ed9 [fix] ListView child layout
Fix #166
2016-07-12 21:18:18 -07:00
3 changed files with 8 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
[![Build Status][travis-image]][travis-url]
[![npm version][npm-image]][npm-url]
![gzipped size](https://img.shields.io/badge/gzipped-~41.0k-blue.svg)
![gzipped size](https://img.shields.io/badge/gzipped-~48.6k-blue.svg)
[React Native][react-native-url] components and APIs for the Web.

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-web",
"version": "0.0.37",
"version": "0.0.38",
"description": "React Native for Web",
"main": "dist/index.js",
"files": [

View File

@@ -3,6 +3,8 @@ import React, { Component } from 'react'
import ScrollView from '../ScrollView'
import ListViewDataSource from './ListViewDataSource'
import ListViewPropTypes from './ListViewPropTypes'
import View from '../View'
import pick from 'lodash/pick'
const SCROLLVIEW_REF = 'listviewscroll'
@@ -64,7 +66,7 @@ class ListView extends Component {
if (renderSectionHeader) {
const section = dataSource.getSectionHeaderData(sectionIdx)
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)
}
@@ -73,7 +75,7 @@ class ListView extends Component {
const rowId = rows[rowIdx]
const row = dataSource.getRowData(sectionIdx, rowIdx)
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)
// render optional separator
@@ -88,12 +90,9 @@ class ListView extends Component {
}
}
const {
renderScrollComponent,
...props
} = this.props
const props = pick(ScrollView.propTypes, this.props)
return React.cloneElement(renderScrollComponent(props), {
return React.cloneElement(this.props.renderScrollComponent(props), {
ref: SCROLLVIEW_REF
}, header, children, footer)
}