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
This commit is contained in:
Sean Kelley
2018-04-12 09:59:44 -07:00
committed by Mohamed Hegazy
parent e372b989c7
commit cdb3807edb
2 changed files with 8 additions and 1 deletions

View File

@@ -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<HTMLInputElement>
cssModule?: CSSModule;
}
declare const Input: React.StatelessComponent<InputProps>;
declare class Input extends React.Component<InputProps> {}
export default Input;

View File

@@ -3676,3 +3676,9 @@ const Example116 = (props: any) => {
</div>
);
};
class Example117 extends React.Component {
render() {
return <Input ref={e => { console.log(e); }}/>;
}
}