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

Typescript error when using HTMLFlipBook

Open nguyenduckhanhks opened this issue 4 years ago • 11 comments

image

I have an warning in my visual studio code when using HTMLFlipBook for NextJs. How can i fix it? I'm using typescript. thanks!

nguyenduckhanhks avatar Aug 29 '21 10:08 nguyenduckhanhks

Yes I'm facing the same issue. I think all attributes except height and width should be marked optional in TS.

lunacd avatar Aug 30 '21 20:08 lunacd

Having the same issue.

pixelsage avatar Aug 31 '21 08:08 pixelsage

Having the same issue x3

DreamoverStudio avatar Nov 04 '21 12:11 DreamoverStudio

Simplest fix for me was to add ts-ignore

import HTMLFlipBook from 'react-pageflip';

const SampleReportFlip = () => {

// @ts-ignore
return    (<HTMLFlipBook width={300} height={500}>
<div className="demoPage">Page 1</div>
<div className="demoPage">Page 2</div>
<div className="demoPage">Page 3</div>
<div className="demoPage">Page 4</div>
</HTMLFlipBook>)
}

export default SampleReportFlip;

aftabq avatar Dec 29 '21 17:12 aftabq

same issue x4. Will use @ts-ignore for now, but this isn't desirable for obvious reasons...

ramorris3 avatar Jan 26 '22 21:01 ramorris3

How can I use this library using typescript? ..

YoonJeongLulu avatar Apr 08 '22 08:04 YoonJeongLulu

same issue..

emmajane1313 avatar Dec 02 '22 00:12 emmajane1313

Same issue. Provided all attr manually. +1 for all attributes except height and width should be marked optional in TS.

roman-kolodiy avatar Mar 09 '23 17:03 roman-kolodiy

i fixed it by add like this <HTMLFlipBook style={{}} // children={{}} startPage={0} width={300} height={500} drawShadow={true} flippingTime={10} usePortrait={false} startZIndex={0} autoSize={false} clickEventForward={false} useMouseEvents={false} swipeDistance={0} showPageCorners={false} disableFlipByClick={false} size="stretch" minWidth={315} maxWidth={1000} minHeight={400} maxHeight={1533} maxShadowOpacity={0.5} showCover={true} mobileScrollSupport={true} onFlip={()=>{}} onChangeOrientation={()=>{}} onChangeState={()=>{}} className="demo-book" > <div className="demoPage">Page 1 <div className="demoPage">Page 2 <div className="demoPage">Page 3 <div className="demoPage">Page 4 </HTMLFlipBook>

tia-aif avatar May 03 '23 03:05 tia-aif