jl- / react-slide-deck

react carousel, swipe, slide deck, showcase, page section scroll ...
MIT License
86 stars 6 forks source link

Possible to add slide dynamically? #8

Closed oertels closed 8 years ago

oertels commented 8 years ago

I'm trying to add a slide under certain circumstances in the render method, but on insertion, I get:

invariant.js:38 Uncaught Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
jl- commented 8 years ago

Hi, @schneck, could you please provide some more details(code maybe)? How you made the insertion?

oertels commented 8 years ago

hi, I'm inserting it within the render() method using a map. untested example:

render() {
    <Deck>
      {mylist.map(item =>
         <Deck.Slide [...] />
      )}
    </Deck>
}
jl- commented 8 years ago

@schneck Sorry for the late reply, but it seems that's not the problem with react-deck-slide, I made a demo here.