darenju / react-flip-page

A React.js implementation of the Flipboard page swipe.
MIT License
173 stars 31 forks source link

Update the value of startAt after the first render #134

Open benjaminviaud opened 4 years ago

benjaminviaud commented 4 years ago

Hello,

I cannot update the startAt props after the first render because the init value is initialize in constructor with props.

In my case my function render

<FlipPage startAt={numPage}  ... >....</FlipPage>

but i fetch book data from db with redux action (content of page, startAt, ...)

componentDidMount(){
     this.props.dispatch(getBook())
}

And after the data loaded I cannot update the startAt value. Is there a way to update this value ?

Thanks for your work.

Ben

darenju commented 4 years ago

Hello, Sorry for the delayed reply… From what you describe, I can see two solutions: