Skip to content

Commit

Permalink
fix(form-builder): add workaround for ts error (TS4023)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Mar 16, 2021
1 parent a39c60c commit 35459cf
Showing 1 changed file with 9 additions and 5 deletions.
Expand Up @@ -3,11 +3,15 @@ import {TextInput} from '@sanity/ui'

type TextInputProps = React.ComponentProps<typeof TextInput>

type Props = Omit<TextInputProps, 'onChange'> & {
onChange?: (
event: React.FocusEvent<HTMLInputElement> | React.ChangeEvent<HTMLInputElement>
) => void
}
// todo: delete this when v0.34 of @sanity/ui is out
type Workaround = any

type Props = Workaround &
Omit<TextInputProps, 'onChange'> & {
onChange?: (
event: React.FocusEvent<HTMLInputElement> | React.ChangeEvent<HTMLInputElement>
) => void
}

/**
* A TextInput that only emit onChange when it has to
Expand Down

0 comments on commit 35459cf

Please sign in to comment.