React native returning typeerror:null is not an object(evaluating feeds.length)

I dont know what is wrong with this react native app that am creating that is returning the above error and I can’t really say this is what is wrong with the code. What I want to do is check if the numbers of feed is greater than zero(0) and if it is, display the content(s) and if not display

No saved feeds

import React from 'react'
import {
  View,
  Text,
  StyleSheet,
  TouchableWithoutFeedback,
  ScrollView
} from 'react-native'

import CenterMessage from '../components/CenterMessage'

import { colors } from '../theme'

export default class Feeds extends React.Component {
  static navigationOptions = {
    title: 'Feeds',
    headerTitleStyle: {
      color: 'white',
      fontSize: 20,
      fontWeight: '400'
    }
  }
  navigate = (item) => {
    this.props.navigation.navigate('Feed', { feed: item })
  }
  render() {
    const { screenProps: { feeds } } = this.props
    return (
      <ScrollView  contentContainerStyle={[!feeds.length && { flex: 1 }]}>// error here !feeds.length
        <View style={[!feeds.length && { justifyContent: 'center', flex: 1 }]}>// error here !feeds.length
          {
            !feeds.length && <CenterMessage message='No saved feeds!' />// error here !feeds.length
          }
          {
            feeds.map((item, index) => (
              <TouchableWithoutFeedback onPress={() => this.navigate(item)} key={index} >

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.