Skip to content

Commit

Permalink
fix: fix typescript error when setting ref on textinput (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaulz authored and Trancever committed Aug 23, 2019
1 parent 6e4afbb commit 52b2756
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/TextInput/TextInput.tsx
Expand Up @@ -15,7 +15,9 @@ import { Theme } from '../../types';
const BLUR_ANIMATION_DURATION = 180;
const FOCUS_ANIMATION_DURATION = 150;

export type TextInputProps = React.ComponentProps<typeof NativeTextInput> & {
export type TextInputProps = React.ComponentPropsWithRef<
typeof NativeTextInput
> & {
/**
* Mode of the TextInput.
* - `flat` - flat input with an underline.
Expand Down Expand Up @@ -396,7 +398,8 @@ class TextInput extends React.Component<TextInputProps, State> {
}

render() {
const { mode, padding, ...rest } = this.props;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { mode, padding, ref: outerRef, ...rest } = this.props;

return mode === 'outlined' ? (
<TextInputOutlined
Expand Down

0 comments on commit 52b2756

Please sign in to comment.