mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Fix NavbarBrand using the correct interface (#20280)
* Fix NavbarBrand using any * Tests for reactstrap NavbarBrand properties
This commit is contained in:
committed by
Wesley Wigham
parent
21badac033
commit
faf18110df
4
types/reactstrap/lib/NavbarBrand.d.ts
vendored
4
types/reactstrap/lib/NavbarBrand.d.ts
vendored
@@ -1,10 +1,10 @@
|
||||
import { CSSModule } from '../index';
|
||||
|
||||
interface NavbarBrand {
|
||||
interface Props extends React.HTMLProps<HTMLAnchorElement> {
|
||||
tag?: React.ReactType;
|
||||
className?: string;
|
||||
cssModule?: CSSModule;
|
||||
}
|
||||
|
||||
declare var NavbarBrand: React.StatelessComponent<React.HTMLProps<any>>;
|
||||
declare var NavbarBrand: React.StatelessComponent<Props>;
|
||||
export default NavbarBrand;
|
||||
|
||||
@@ -3412,3 +3412,75 @@ class Example110 extends React.Component<any, any> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Example111 extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.state = {
|
||||
isOpen: false
|
||||
};
|
||||
}
|
||||
toggle() {
|
||||
this.setState({
|
||||
isOpen: !this.state.isOpen
|
||||
});
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Navbar color="faded" light expand="md">
|
||||
<NavbarToggler right onClick={this.toggle} />
|
||||
<NavbarBrand tag="a" href="/">reactstrap</NavbarBrand>
|
||||
<Collapse isOpen={this.state.isOpen} navbar>
|
||||
<Nav className="ml-auto" navbar>
|
||||
<NavItem>
|
||||
<NavLink href="/components/">Components</NavLink>
|
||||
</NavItem>
|
||||
<NavItem>
|
||||
<NavLink href="https://github.com/reactstrap/reactstrap">Github</NavLink>
|
||||
</NavItem>
|
||||
</Nav>
|
||||
</Collapse>
|
||||
</Navbar>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Example112 extends React.Component<any, any> {
|
||||
constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.toggle = this.toggle.bind(this);
|
||||
this.state = {
|
||||
isOpen: false
|
||||
};
|
||||
}
|
||||
toggle() {
|
||||
this.setState({
|
||||
isOpen: !this.state.isOpen
|
||||
});
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Navbar color="faded" light expand="md">
|
||||
<NavbarToggler right onClick={this.toggle} />
|
||||
<NavbarBrand className="logo" href="/">reactstrap</NavbarBrand>
|
||||
<Collapse isOpen={this.state.isOpen} navbar>
|
||||
<Nav className="ml-auto" navbar>
|
||||
<NavItem>
|
||||
<NavLink href="/components/">Components</NavLink>
|
||||
</NavItem>
|
||||
<NavItem>
|
||||
<NavLink href="https://github.com/reactstrap/reactstrap">Github</NavLink>
|
||||
</NavItem>
|
||||
</Nav>
|
||||
</Collapse>
|
||||
</Navbar>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user