mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-14 12:09:04 +08:00
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:
committed by
Mohamed Hegazy
parent
e372b989c7
commit
cdb3807edb
3
types/reactstrap/lib/Input.d.ts
vendored
3
types/reactstrap/lib/Input.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -3676,3 +3676,9 @@ const Example116 = (props: any) => {
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
class Example117 extends React.Component {
|
||||
render() {
|
||||
return <Input ref={e => { console.log(e); }}/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user