From 51785aa6ebed1e60a14baf79a45e6a587d433d16 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 1 Nov 2017 11:47:22 +0800 Subject: [PATCH] deps: upgrade TypeScript to 2.6, close #8018 --- components/auto-complete/InputElement.tsx | 8 ++++++-- components/input/TextArea.tsx | 8 ++++++-- package.json | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/auto-complete/InputElement.tsx b/components/auto-complete/InputElement.tsx index f807db8eef..9c40304201 100644 --- a/components/auto-complete/InputElement.tsx +++ b/components/auto-complete/InputElement.tsx @@ -1,7 +1,11 @@ import React from 'react'; import { findDOMNode } from 'react-dom'; -export default class InputElement extends React.Component { +export interface InputElementProps { + children: React.ReactElement; +} + +export default class InputElement extends React.Component { private ele: HTMLInputElement; focus = () => { @@ -12,7 +16,7 @@ export default class InputElement extends React.Component { } saveRef = (ele: HTMLInputElement) => { this.ele = ele; - const childRef = this.props.children.ref; + const { ref: childRef } = this.props.children as any; if (typeof childRef === 'function') { childRef(ele); } diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index b6966b627f..acdbf2687e 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -29,9 +29,13 @@ export interface TextAreaProps extends AbstractInputProps { onPressEnter?: React.FormEventHandler; } +export interface TextAreaState { + textareaStyles?: React.CSSProperties; +} + export type HTMLTextareaProps = React.TextareaHTMLAttributes; -export default class TextArea extends React.Component { +export default class TextArea extends React.Component { static defaultProps = { prefixCls: 'ant-input', }; @@ -39,7 +43,7 @@ export default class TextArea extends React.Component