retyui / react-quick-pinch-zoom

A react component that providing multi-touch gestures for zooming and dragging on any DOM element.
https://react-quick-pinch-zoom.netlify.app/
310 stars 47 forks source link

Styling question #81

Closed rurigrass closed 1 year ago

rurigrass commented 1 year ago

Is there a way of styling the QuickPinchZoom container?

retyui commented 1 year ago
<QuickPinchZoom 
  className={'your-class'}
  style={{
    // your style )
rurigrass commented 1 year ago

I get the following error:

Property 'style' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Pick<Readonly, "onUpdate" | "children"> & InexactPartial<...> & InexactPartial<...>'. Overload 2 of 2, '(props: Props, context: any): PinchZoom', gave the following error. Type '{ children: Element; onUpdate: ({ x, y, scale }: { x: number; y: number; scale: number; }) => void; centerContained: true; doubleTapToggleZoom: true; wheelScaleFactor: number; shouldInterceptWheel: (event: WheelEvent) => boolean; style: {}; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Pick<Readonly, "onUpdate" | "children"> & InexactPartial<...> & InexactPartial<...>'. Property 'style' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Pick<Readonly, "onUpdate" | "children"> & InexactPartial<...> & InexactPartial<...>'.ts(2769)

retyui commented 1 year ago

sorry my bad:

that should works

<QuickPinchZoom 
  containerProps={{
    className:className
    style: {/* your styles */},
  }}