Skip to content

v1.3.0

Compare
Choose a tag to compare
@github-actions github-actions released this 02 Dec 04:04
· 7 commits to main since this release

Buy me a coffee

Documentation v1.3.0: https://raw.githack.com/uiwjs/react-signature/bab8ae4/index.html
Comparing Changes: v1.2.3...v1.3.0

Canvas

Experimental components

import Signature from '@uiw/react-signature/canvas';
import React, { useRef } from "react";
import Signature from '@uiw/react-signature/canvas';

export default function App() {
  const $canvas = useRef(null);
  const handle = (evn) => $canvas.current?.clear();
  return (
      <Signature ref={$canvas} width="450" height="230"  />
  );
}

Enhance the renderPath props

export interface SignatureProps extends React.SVGProps<SVGSVGElement> {
    prefixCls?: string;
    options?: StrokeOptions;
    readonly?: boolean;
    defaultPoints?: Record<string, number[][]>;
-    renderPath?: (d: string, keyName: string, point: number[][], index: number) => JSX.Element;
+    renderPath?: (d: string, keyName: string, point: number[][], index: number, container: SVGSVGElement) => JSX.Element;
    onPointer?: (points: number[][]) => void;
}