inProgress-team / react-native-meteor

Meteor Reactivity for your React Native application :)
MIT License
693 stars 210 forks source link

Can't get MeteorListView scrolling to work #305

Closed 814k31 closed 6 years ago

814k31 commented 6 years ago

Tried following the example but had no success Whenever my MeteorListView renders it refuses to allow scrolling Is it something obvious I'm missing?

Also ListView has been deprecated

"dependencies": {
    "react": "^16.3.1",
    "react-native": "^0.54.4",
    "react-native-meteor": "^1.2.0",
    "react-router-native": "^4.2.0",
},
    // Scrolling Doesn't Work
    renderItems() {
        return this.props.itemsReady ? (
            <View style={{flex: 1}}>
                <MeteorListView
                    enableEmptySections={true}
                    collection="items"
                    contentContainerStyle={{flex: 1}}
                    options={{ sort: {dateCreated: -1}, limit: 20 }}
                    renderRow={(item) => {
                        return (
                            <View style={{ marginTop: 5, marginBottom: 5 }}>
                                <Text style={{fontWeight: 'bold'}}>{item.name}</Text>
                                <Text>{item.description}</Text>
                            </View>
                        );
                    }}
                />
            </View>
        ) : <ActivityIndicator size="large" color="#00ff00" />
    }
    // Scrolling Does Work
    renderMockListView() {
        return this.props.itemsReady ? (
            <View style={{flex: 1}}>
                <ListView
                    enableEmptySections={true}
                    dataSource={ this.state.listViewData } // Gets set to the Same data when the collection is ready
                    renderRow={(item) => {
                        return (
                            <View style={{ marginTop: 5, marginBottom: 5 }}>
                                <Text style={{fontWeight: 'bold'}}>{item.name}</Text>
                                <Text>{item.description}</Text>
                            </View>
                        );
                    }}
                />
            </View>
        ) : <ActivityIndicator size="large" color="#00ff00" />;
    }
814k31 commented 6 years ago

... removed contentContainerStyle={{flex: 1}} and it worked