react-pageflip icon indicating copy to clipboard operation
react-pageflip copied to clipboard

TypeError _this2.flipBook.getPageFlip is not a function

Open raana96 opened this issue 3 years ago • 3 comments

react-pageflip has a problem with nextjs and getPageFlip does not work.

https://stackoverflow.com/questions/68883595/typeerror-this2-flipbook-getpageflip-is-not-a-function

raana96 avatar Aug 23 '21 19:08 raana96

Experiencing the same issue!

on version 2.0.3 react: 17.0.2

HarshaDW avatar Sep 20 '21 19:09 HarshaDW

Have you guys got anything related to this or any alternative for flipbook? I am facing same issue

Sanaullahbugti avatar Oct 08 '21 07:10 Sanaullahbugti

For function components This work for me

const bookRef = useRef(null)

const nextButtonClick = () => {
    bookRef.current.pageFlip().flipNext()
  }

 const prevButtonClick = () => {
    bookRef.current.pageFlip().flipPrev()
  }
  
<HTMLFlipBook
  onFlip={onFlip}
  width={616}
  height={872}
  showCover={true}
  ref={bookRef}
>
// ...my render page
</HTMLFlipBook>

nixjke avatar Feb 11 '23 19:02 nixjke