[reactstrap] Add setActiveFromChild prop

This commit is contained in:
Flosch
2018-05-11 18:43:48 +02:00
parent ccbd12e286
commit 7ea7631815
2 changed files with 22 additions and 0 deletions

View File

@@ -14,7 +14,9 @@ export type UncontrolledProps<T = {}> = React.HTMLAttributes<HTMLElement> & {
cssModule?: CSSModule;
nav?: boolean;
inNavbar?: boolean;
setActiveFromChild?: boolean;
} & T;
export type UncontrolledDropdownProps<T = {}> = UncontrolledProps<T>;
export type Props<T = {}> = UncontrolledProps<T> & {
@@ -25,6 +27,7 @@ export type Props<T = {}> = UncontrolledProps<T> & {
tag?: React.ReactType;
addonType?: boolean | 'prepend' | 'append';
};
export type DropdownProps<T = {}> = Props<T>;
declare class Dropdown<T = {[key: string]: any}> extends React.Component<DropdownProps<T>> {}

View File

@@ -4177,3 +4177,22 @@ class Example120 extends React.Component<any, any> {
);
}
}
class Example120 extends React.Component<any, any> {
render() {
return (
<UncontrolledDropdown className="some-class" setActiveFromChild>
<DropdownToggle caret>
Dropdown
</DropdownToggle>
<DropdownMenu>
<DropdownItem header>Header</DropdownItem>
<DropdownItem disabled>Action</DropdownItem>
<DropdownItem>Another Action</DropdownItem>
<DropdownItem divider />
<DropdownItem>Another Action</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
);
}
}