Fix ListView imports for React Native 0.25

Fixes #433
This commit is contained in:
Scott Kyle 2016-05-16 13:23:19 -07:00
parent e304cd0032
commit 51b7a43c40
2 changed files with 8 additions and 7 deletions

View File

@ -18,4 +18,6 @@
'use strict'; 'use strict';
exports.ListView = require('./listview'); import ListView from './listview';
export { ListView };

View File

@ -18,7 +18,8 @@
'use strict'; 'use strict';
const React = require('react-native'); import React from 'react';
import { ListView as BaseListView } from 'react-native';
function hashObjects(array) { function hashObjects(array) {
let hash = Object.create(null); let hash = Object.create(null);
@ -28,7 +29,7 @@ function hashObjects(array) {
return hash; return hash;
} }
class ListViewDataSource extends React.ListView.DataSource { class ListViewDataSource extends BaseListView.DataSource {
cloneWithRowsAndSections(inputData, sectionIds, rowIds) { cloneWithRowsAndSections(inputData, sectionIds, rowIds) {
let data = {}; let data = {};
@ -160,7 +161,7 @@ class ListViewDataSource extends React.ListView.DataSource {
} }
} }
class ListView extends React.Component { export default class ListView extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -169,7 +170,7 @@ class ListView extends React.Component {
render() { render() {
return ( return (
<React.ListView {...this.props} ref="listView" renderRow={this.renderRow} /> <BaseListView {...this.props} ref="listView" renderRow={this.renderRow} />
); );
} }
@ -200,5 +201,3 @@ ListView.propTypes = {
}; };
ListView.DataSource = ListViewDataSource; ListView.DataSource = ListViewDataSource;
module.exports = ListView;