From faf18110dfdf2ad6fef6f9fc0651e0f83f7fa472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Paiva?= Date: Tue, 10 Oct 2017 00:57:49 +0200 Subject: [PATCH] Fix NavbarBrand using the correct interface (#20280) * Fix NavbarBrand using any * Tests for reactstrap NavbarBrand properties --- types/reactstrap/lib/NavbarBrand.d.ts | 4 +- types/reactstrap/reactstrap-tests.tsx | 72 +++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/types/reactstrap/lib/NavbarBrand.d.ts b/types/reactstrap/lib/NavbarBrand.d.ts index 94239da4f8..3748a2903f 100644 --- a/types/reactstrap/lib/NavbarBrand.d.ts +++ b/types/reactstrap/lib/NavbarBrand.d.ts @@ -1,10 +1,10 @@ import { CSSModule } from '../index'; -interface NavbarBrand { +interface Props extends React.HTMLProps { tag?: React.ReactType; className?: string; cssModule?: CSSModule; } -declare var NavbarBrand: React.StatelessComponent>; +declare var NavbarBrand: React.StatelessComponent; export default NavbarBrand; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index dc69e6d298..8a3be49209 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -3412,3 +3412,75 @@ class Example110 extends React.Component { ); } } + +class Example111 extends React.Component { + constructor(props: any) { + super(props); + + this.toggle = this.toggle.bind(this); + this.state = { + isOpen: false + }; + } + toggle() { + this.setState({ + isOpen: !this.state.isOpen + }); + } + render() { + return ( +
+ + + reactstrap + + + + +
+ ); + } +} + +class Example112 extends React.Component { + constructor(props: any) { + super(props); + + this.toggle = this.toggle.bind(this); + this.state = { + isOpen: false + }; + } + toggle() { + this.setState({ + isOpen: !this.state.isOpen + }); + } + render() { + return ( +
+ + + reactstrap + + + + +
+ ); + } +}