Nodlik / react-pageflip

Simple React.js wrapper for StPageFlip library, for creating realistic and beautiful page turning effect
https://nodlik.github.io/react-pageflip/
MIT License
476 stars 91 forks source link

Typescript error when using HTMLFlipBook #21

Open nguyenduckhanhks opened 3 years ago

nguyenduckhanhks commented 3 years ago

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!

lunacd commented 3 years ago

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

pixelsage commented 3 years ago

Having the same issue.

DreamoverStudio commented 3 years ago

Having the same issue x3

aftabq commented 2 years ago

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;
ramorris3 commented 2 years ago

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

YoonJeongLulu commented 2 years ago

How can I use this library using typescript? ..

emmajane1313 commented 2 years ago

same issue..

roman-kolodiy commented 1 year ago

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

tia-aif commented 1 year ago

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"

Page 1
Page 2
Page 3
Page 4

Parthiv-M commented 1 month ago

Same issue, all attributes should be optional except height and width.