drcmda / mauerwerk

⚒ A react-spring driven masonry-like grid with enter/exit and shared element transitions
MIT License
836 stars 55 forks source link

complex object generating an error #7

Open atherdon opened 5 years ago

atherdon commented 5 years ago

so, at the demo we have this array:

[
  {
    name: 'Rare Wind',
    description: '#a8edea → #fed6e3',
    css: 'linear-gradient(to top, #a8edea 0%, #fed6e3 100%)',
    height: 200
  },
  {
    name: 'Saint Petersburg',
    description: '#f5f7fa → #c3cfe2',
    css: 'linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%)',
    height: 400
  }
]

and grid working fine i tried to feed it with 2x object and things falling apart.

[
 {
    key: "0d7987d0-0f8b-11e9-b2bc-8fce1edba3a5",
    recipe: {
       directions: (4) ["Place beef roast in crock pot.", "Mix the dried mixes together in a bowl and sprinkle over the roast.", "Pour the water around the roast.", "Cook on low for 7-9 hours."],
       img: "http://img.sndimg.com/food/image/upload/w_266/v1/img/recipes/27/20/8/picVfzLZo.jpg",
       prep_time: "30min",
       recipe_yield: "8",
       title: "Crock Pot Roast",
      total_time: "3h",
      url: "http://www.food.com/recipe/to-die-for-crock-pot-roast-27208"
    }
 }
]

just want to report it - in order to contribute. if this is fine - just close the issue. btw, nice work!

drcmda commented 5 years ago

Can i see the grid config? Do you give it the right keys? (item => item.key)

atherdon commented 5 years ago

@drcmda i think it was default config from extended demo. But when you ask - i think i'm not sure :) give me some time - i'll create a sandbox example - i think it'll be easy for you