Question: I am fetching a list of **orders** in my React/Redux app. The user types a word into the "Search" component and a list of orders should display below in the "List" component. From inside of the "List" component I console.log(orders), it returns an empty array (i default the state to be an empty array) when I submit a search term it returns an array with 5 items.

```
[] 
orders: (5) [{…}, {…}, {…}, {…}, {…}]

```

However, if I console.log(orders.length) i get '0' but once I submit a search it returns undefined. Why? Is it not an array?

```
[]
0
{orders: Array(5)}
undefined

```

List Component:

```
export class List extends React.Component {
  render() {
    const { orders } = this.props;
    console.log(orders.orders);

    return <div>List Component</div>;
  }
}

const mapStateToProps = state => ({
  orders: state.orders.ordersArr
});

```

Reducer:

```
  const initialState = {
     name: '',
     ordersArr: []
  };
  export default (state = initialState, action) => {
     switch (action.type) {
        case 'FETCH_ORDERS':
          return { ...state, ordersArr: action.payload };

```

Reducers Index

```
export default combineReducers({
  orders: ordersReducer
});

```

Action:

```
export const fetchOrders = () => async dispatch => {
  const response = await work.get(`/needtoorders`);

  dispatch({ type: 'FETCH_ORDERS', payload: response.data });
};

```

Answer: 
It seems that `orders` is an object, consisting of a property called `orders` as well. And that property consists on an array. 

Try this instead:

```
console.log(orders.orders.length) 

```

Given that `orders` and `orders.orders` might be undefined, you may try this too.

```
if (orders && orders.orders && orders.orders.length > 0) {
  console.log(orders.orders.length)
}

```
Can you try this

```
if (orders && orders.orders && orders.orders.length > 0) {
  console.log(orders.orders.length)
}

```

Hope it helps