[reactstrap] Fixed the error that was preventing from extending the Button component with custom props (#29595)

* Fixed the error that was preventing from extending the Button component with custom props

* Changed from All to more specific ButtonHTMLProps
This commit is contained in:
Jaff Parker
2018-10-15 09:35:03 -07:00
committed by Sheetal Nandi
parent 3e3b7cf82e
commit f51705da30
2 changed files with 7 additions and 2 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import * as React from 'react';
import { CSSModule } from '../index';
export type ButtonProps<T = {}> = React.HTMLProps<HTMLButtonElement> & {
export type ButtonProps<T = {}> = React.ButtonHTMLAttributes<HTMLButtonElement> & {
outline?: boolean;
active?: boolean;
block?: boolean;
+6 -1
View File
@@ -278,6 +278,11 @@ const Example13 = (
</div>
);
interface CustomButtonProps extends ButtonProps {
customProp: string;
}
const CustomButton: React.SFC<CustomButtonProps> = props => <Button {...props} />;
class Example14 extends React.Component<any, any> {
state: any;
constructor(props: any) {
@@ -3759,7 +3764,7 @@ import { default as Alert_ } from './lib/Alert'; /* tslint:disable-line: no-rela
import { default as Badge_ } from './lib/Badge'; /* tslint:disable-line: no-relative-import-in-test */
import { default as Breadcrumb_ } from './lib/Breadcrumb'; /* tslint:disable-line: no-relative-import-in-test */
import { default as BreadcrumbItem_ } from './lib/BreadcrumbItem'; /* tslint:disable-line: no-relative-import-in-test */
import { default as Button_ } from './lib/Button'; /* tslint:disable-line: no-relative-import-in-test */
import { default as Button_, ButtonProps } from './lib/Button'; /* tslint:disable-line: no-relative-import-in-test */
import { default as ButtonDropdown_ } from './lib/ButtonDropdown'; /* tslint:disable-line: no-relative-import-in-test */
import { default as ButtonGroup_ } from './lib/ButtonGroup'; /* tslint:disable-line: no-relative-import-in-test */
import { default as ButtonToolbar_ } from './lib/ButtonToolbar'; /* tslint:disable-line: no-relative-import-in-test */