Skip to content

Commit

Permalink
typings fixes required in new version
Browse files Browse the repository at this point in the history
  • Loading branch information
agilgur5 committed Dec 31, 2024
1 parent 478dc4f commit f3e1a78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface SignatureCanvasProps extends SignaturePad.SignaturePadOptions {
}

export class SignatureCanvas extends Component<SignatureCanvasProps> {
static propTypes = {
static override propTypes = {
// signature_pad's props
velocityFilterWeight: PropTypes.number,
minWidth: PropTypes.number,
Expand Down
2 changes: 1 addition & 1 deletion test/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React from 'react'
import { SignatureCanvas, SignatureCanvasProps } from '../src/index'
import { propsF, dotF } from './fixtures'

function renderSCWithRef (props?: SignatureCanvasProps): { wrapper: RenderResult, instance: SignatureCanvas, ref: React.RefObject<SignatureCanvas> } {
function renderSCWithRef (props?: SignatureCanvasProps): { wrapper: RenderResult, instance: SignatureCanvas, ref: React.RefObject<SignatureCanvas | null> } {
const ref = React.createRef<SignatureCanvas>()
const wrapper = render(<SignatureCanvas {...props} ref={ref} />)
const instance = ref.current! // eslint-disable-line @typescript-eslint/no-non-null-assertion -- this simplifies the code; it does exist immediately after render. it won't exist after unmount, but we literally test for that separately
Expand Down

0 comments on commit f3e1a78

Please sign in to comment.