From cdb3807edbfce9a848035bf997bfad95756f83ba Mon Sep 17 00:00:00 2001 From: Sean Kelley Date: Thu, 12 Apr 2018 09:59:44 -0700 Subject: [PATCH] reactstrap: Input from StatelessComponent to React.Component subclass (#24846) * reactstrap: Input from StatelessComponent to ComponentClass `Input` is a full React component (`ComponentClass`), not a stateless component. In particular, this change allows consumers to pass `ref` to it (not legal with `StatelessComponent`), which useful for e.g. calling `HTMLInputElement#focus()`. * ComponentClasss -> extends React.Component --- types/reactstrap/lib/Input.d.ts | 3 ++- types/reactstrap/reactstrap-tests.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/types/reactstrap/lib/Input.d.ts b/types/reactstrap/lib/Input.d.ts index 3da3691ea8..eddd8089be 100644 --- a/types/reactstrap/lib/Input.d.ts +++ b/types/reactstrap/lib/Input.d.ts @@ -1,3 +1,4 @@ +import * as React from 'react'; import { CSSModule } from '../index'; export type InputType = @@ -41,5 +42,5 @@ export interface InputProps extends React.InputHTMLAttributes cssModule?: CSSModule; } -declare const Input: React.StatelessComponent; +declare class Input extends React.Component {} export default Input; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 8b58c9f886..1b777d173c 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -3676,3 +3676,9 @@ const Example116 = (props: any) => { ); }; + +class Example117 extends React.Component { + render() { + return { console.log(e); }}/>; + } +}