From 7e5f12eec1e5c69313ef6732a58073eec98e1494 Mon Sep 17 00:00:00 2001 From: Neil Gentleman Date: Wed, 10 Oct 2018 12:54:46 -0700 Subject: [PATCH] [react-bootstrap] fix Dropdown.Menu (#29452) * [react-bootstrap] remove incorrect exports several sub-components are exported in index.d.ts, when they are not in the library itself. should fail: `import { DropdownMenu } from 'react-bootstrap';` should succeed: `import { Dropdown } from 'react-bootstrap';` `import DropdownMenu from 'react-bootstrap/lib/DropdownMenu';` * [react-bootstrap] fix Dropdown.Menu typing DropdownMenu uses `export =`, so the import must use require, `import *`. this matches the pattern in Carousel, FormControl, etc. --- types/react-bootstrap/lib/Dropdown.d.ts | 6 +-- types/react-bootstrap/lib/index.d.ts | 50 ------------------- ...-bootstrap-individual-components-tests.tsx | 41 +++++++++++++++ 3 files changed, 43 insertions(+), 54 deletions(-) diff --git a/types/react-bootstrap/lib/Dropdown.d.ts b/types/react-bootstrap/lib/Dropdown.d.ts index 1568e6cfb5..a3f8220da7 100644 --- a/types/react-bootstrap/lib/Dropdown.d.ts +++ b/types/react-bootstrap/lib/Dropdown.d.ts @@ -1,7 +1,7 @@ import * as React from 'react'; import { SelectCallback } from 'react-bootstrap'; -import * as DropdownToggle from './DropdownToggle'; -import * as DropdownMenu from './DropdownMenu'; +import DropdownToggle = require('./DropdownToggle'); +import DropdownMenu = require('./DropdownMenu'); declare namespace Dropdown { export interface DropdownBaseProps { @@ -26,5 +26,3 @@ declare class Dropdown extends React.Component { public static Toggle: typeof DropdownToggle; } export = Dropdown; - - diff --git a/types/react-bootstrap/lib/index.d.ts b/types/react-bootstrap/lib/index.d.ts index 1b59d08457..4a3c27a59c 100644 --- a/types/react-bootstrap/lib/index.d.ts +++ b/types/react-bootstrap/lib/index.d.ts @@ -208,8 +208,6 @@ export { ButtonToolbarProps, Carousel, CarouselProps, - CarouselCaption, - CarouselCaptionProps, CarouselItem, CarouselItemProps, Checkbox, @@ -226,20 +224,12 @@ export { DropdownProps, DropdownButton, DropdownButtonProps, - DropdownMenu, - DropdownMenuProps, - DropdownToggle, - DropdownToggleProps, Fade, FadeProps, Form, FormProps, FormControl, FormControlProps, - FormControlFeedback, - FormControlFeedbackProps, - FormControlStatic, - FormControlStaticProps, FormGroup, FormGroupProps, Glyphicon, @@ -252,10 +242,6 @@ export { ImageProps, InputGroup, InputGroupProps, - InputGroupAddon, - InputGroupAddonProps, - InputGroupButton, - InputGroupButtonProps, Jumbotron, JumbotronProps, Label, @@ -266,18 +252,6 @@ export { ListGroupItemProps, Media, MediaProps, - MediaBody, - MediaBodyProps, - MediaHeading, - MediaHeadingProps, - MediaLeft, - MediaLeftProps, - MediaList, - MediaListProps, - MediaListItem, - MediaListItemProps, - MediaRight, - MediaRightProps, MenuItem, MenuItemProps, Modal, @@ -298,12 +272,6 @@ export { NavbarProps, NavbarBrand, NavbarBrandProps, - NavbarCollapse, - NavbarCollapseProps, - NavbarHeader, - NavbarHeaderProps, - NavbarToggle, - NavbarToggleProps, NavDropdown, NavDropdownProps, NavItem, @@ -318,26 +286,10 @@ export { PageItemProps, Pager, PagerProps, - PagerItem, - PagerItemProps, Pagination, PaginationProps, - PaginationItem, - PaginationItemProps, Panel, PanelProps, - PanelHeading, - PanelHeadingProps, - PanelTitle, - PanelTitleProps, - PanelToggle, - PanelToggleProps, - PanelCollapse, - PanelCollapseProps, - PanelBody, - PanelBodyProps, - PanelFooter, - PanelFooterProps, PanelGroup, PanelGroupProps, Popover, @@ -354,8 +306,6 @@ export { SafeAnchorProps, SplitButton, SplitButtonProps, - SplitToggle, - SplitToggleProps, Tab, TabProps, TabContainer, diff --git a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx index 9457cea4a2..c2f1e1e9c8 100644 --- a/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx +++ b/types/react-bootstrap/test/react-bootstrap-individual-components-tests.tsx @@ -115,6 +115,7 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component { +