Get .map is not function İssue And Solving About (Redux)

if response is like that
{
  • data: 
    {
    • id: 1,
    • name: "Adana",
    • Ads: 
      [
      • {
        • id: 1,
        • user_id: 12,
        • title: "deneme",
        • desc: "deneme",
        • condition: 5,
        • view: 0,
        • swapCount: 0,
        • state_id: 1,
        • city_id: 1,
        • category_id: 50,
        • created_at: null,
        • updated_at: null
        },
      • {
        • id: 2,
        • user_id: 5,
        • title: "dede",
        • desc: "edede",
        • condition: 5,
        • view: 0,
        • swapCount: 0,
        • state_id: 1,
        • city_id: 2,
        • category_id: 51,
        • created_at: null,
        • updated_at: null
        },

 You must define reducer's initial state is state={}

or
{
  • data: 
    [
    • {
      • id: 50,
      • name: "Cep telefonu",
      • pic_url: "fa fa-mobile"
      },
    • {
      • id: 51,
      • name: "Elektronik",
      • pic_url: "fa fa-laptop"
      },
    • {
      • id: 52,
      • name: "Araba",
      • pic_url: "fa fa-car"
      },
    • {
      • id: 53,
      • name: "Bisiklet",
      • pic_url: "fa fa-motorcycle"
      },

Your initial state  must be state=[]

Yorumlar

Bu blogdaki popüler yayınlar

React Router Params

React & Redux (Başlangıç) 1

React HighOrderComponent Nedir ?