Open Kamalakar-Gavali opened 3 years ago
same problem and i try to use turnToPage but its displaying wrong image (only go to first page) too.
I'm having the same problem.
I'm having this problem too. If you use turnToPage(), the project will work as you want, but if you use flip(), you'll be turned over to the page you want, and then back to the previous page + page 1.
useEffect(() => {
if (bookRef?.current?.pageFlip()?.flip) {
console.log(`curPage: ${curPage.page}`);
bookRef.current.pageFlip().flip(curPage.page * 2 - 2);
console.log(curPage.page * 2 - 2);
}
}, [curPage]);
If you change 'flip()' to 'turnToPage()' in the code above, the animation disappears, but the logic operates normally. I'm trying to render a fairy tale book consisting of tree-type data whose ending depends on the user's click. For example, you want to allow books to be turned over in the order of 0 -> 2 -> 4 -> 6 -> 8 -> 10 -> 10 -> 12 -> 14 -> 18 -> 26 -> 34 index.
Do you have any good ideas?
Is there a way to go through the code of the flip() function and correct it yourself?
Bascially inside FlipBook i have map array of images, and added on text box to enter index and calling flip(index) but its displaying wrong image. i am using its like slider not ebook beacasue i want same effect which is in this library