title: How to use reselect createStructuredSelector function with typescript?
body: <p>I am trying to build an react redux typescript app.</p>
  
  <p>I am using reslect library to create selectors.</p>
  
  <p>I am getting an error while using createStructuredSlectore. Please find the error beolow.</p>
  
  <p>Error: No overload matches this call</p>
  
  <p>Please find the code below:</p>
  
  <pre><code>import React from 'react';
  import { connect } from 'react-redux';
  import { createStructuredSelector } from 'reselect';
  
  import { toggleDropDown } from '../../redux/cart/cart.actions';
  import { selectItemCount } from '../../redux/cart/cart.selectors';
  
  import { ReactComponent as ShoppingIcon } from '../../assets/11.2 shopping-bag.svg.svg';
  
  import './cart-icon.component.scss';
  
  interface ICartIconProps {
      toggleDropDown: () =&gt; void;
      itemCount: number;
  }
  
  const CartIcon: React.FC&lt;ICartIconProps&gt; = ({toggleDropDown, itemCount}) =&gt; (
      &lt;div className='cart-icon' onClick={toggleDropDown}&gt;
          &lt;ShoppingIcon className='shopping-icon'/&gt;
          &lt;span className='item-count'&gt;{itemCount}&lt;/span&gt;
      &lt;/div&gt;
  )
  
  const mapDispatchToProps = (dispatch: import('redux').Dispatch) =&gt; ({
      toggleDropDown: () =&gt; dispatch(toggleDropDown())
  })
  
  // If I use Below code its working fine
  // const mapStateToProps = (state: AppState) =&gt; ({
  //     itemCount: selectItemCount(state)
  // })
  
  // Iam getiing error here with below code
  const mapStateToProps = createStructuredSelector({
      itemCount: selectItemCount,
  })
  
  
  
  export default connect(mapStateToProps, mapDispatchToProps)(CartIcon);
  </code></pre>
  
  <p>Slectors.ts</p>
  
  <pre><code>import { createSelector } from 'reselect'
  
  import { AppState } from '../store'
  import { ShopItem } from '../../models/collection.model'
  
  const selectCart = (state: AppState) =&gt; state.cart
  
  export const selectCartItems = createSelector(
    [selectCart],
    cart =&gt; cart.cartItems
  );
  
  export const selectHidden = createSelector(
    [selectCart],
    cart =&gt; cart.hidden
  );
  
  export const selectItemCount = createSelector(
    [selectCartItems],
    (cartItems: ShopItem[]) =&gt; {
      return cartItems.reduce(
        (accumulatedValue, cartItem) =&gt;
          accumulatedValue + (cartItem.quantity as number),
        0
      )
    }
  );
  </code></pre>
  
  <p>cart.reducer.ts</p>
  
  <pre><code>import { CartActionsTypes } from "./cart.types";
  import { addItemToCart } from "./cart.utils";
  
  const INITIAL_STATE = {
      hidden:  true,
      cartItems: []
  };
  
  const cartReducer = (state = INITIAL_STATE, action) =&gt; {
      switch (action.type) {
          case CartActionsTypes.TOGGLE_CART_DROPDOWN:
              return {
                  ...state,
                  hidden: !state.hidden
              }
          case CartActionsTypes.ADD_ITEM:
              return {
                  ...state,
                  cartItems: addItemToCart(state.cartItems, action.payload)
              }    
          default:
              return state;
      }
  }
  
  export default cartReducer;
  </code></pre>
  
  <p>also It is good to have an example.</p>