jamesmoriarty / react-instagram-authless-feed

React component to provide a token-less Instagram feed.
http://www.jamesmoriarty.xyz/react-instagram-authless-feed/
49 stars 18 forks source link

Return a map of <Media /> #2

Closed Dan-Wood closed 4 years ago

Dan-Wood commented 4 years ago

Is it possible to just return a map() of instead of a wrapping

?

`

{this.state.media.map((media, index) => (

    ))}
  </div>

`

To

` {this.state.media.map((media, index) => (

    ))}

`

It gives the user more control over the wrapping elements. Where I was to set each 's class to "col-6 col-lg-4" (Bootstrap) wrapping it in a

jamesmoriarty commented 4 years ago

In React you need to return a single root element so I don't expect to be able to do that.

If you include the markup you want to wrap it in I can have a think about how to make it configureable. e.g.

<row>
  <Media>
  <Media>
  <Media>
</row>
<row>
  <Media>
  ...

Alternatively you could use Instagram.getFeed(username) # => [<MediaObject>] Reference: https://github.com/jamesmoriarty/react-instagram-authless-feed/blob/master/src/lib/Instagram.js