mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[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.
This commit is contained in:
+2
-4
@@ -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<Dropdown.DropdownProps> {
|
||||
public static Toggle: typeof DropdownToggle;
|
||||
}
|
||||
export = Dropdown;
|
||||
|
||||
|
||||
|
||||
Vendored
-50
@@ -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,
|
||||
|
||||
@@ -115,6 +115,7 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<Badge />
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem />
|
||||
<Breadcrumb.Item />
|
||||
</Breadcrumb>
|
||||
<Button />
|
||||
<ButtonGroup><Button /></ButtonGroup>
|
||||
@@ -131,12 +132,16 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<Collapse />
|
||||
<ControlLabel />
|
||||
<Dropdown id="foo" />
|
||||
<Dropdown.Menu />
|
||||
<Dropdown.Toggle />
|
||||
<DropdownButton id="foo" title="bar" />
|
||||
<DropdownMenu />
|
||||
<DropdownToggle />
|
||||
<Fade />
|
||||
<Form />
|
||||
<FormControl />
|
||||
<FormControl.Feedback />
|
||||
<FormControl.Static />
|
||||
<FormControlFeedback />
|
||||
<FormControlStatic />
|
||||
<FormGroup />
|
||||
@@ -145,6 +150,8 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<HelpBlock />
|
||||
<Image />
|
||||
<InputGroup />
|
||||
<InputGroup.Addon />
|
||||
<InputGroup.Button />
|
||||
<InputGroupAddon />
|
||||
<InputGroupButton />
|
||||
<Jumbotron />
|
||||
@@ -152,6 +159,12 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<ListGroup />
|
||||
<ListGroupItem />
|
||||
<Media />
|
||||
<Media.Body />
|
||||
<Media.Heading />
|
||||
<Media.Left />
|
||||
<Media.List />
|
||||
<Media.ListItem />
|
||||
<Media.Right />
|
||||
<MediaBody />
|
||||
<MediaHeading />
|
||||
<MediaLeft />
|
||||
@@ -160,6 +173,11 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<MediaRight />
|
||||
<MenuItem />
|
||||
<Modal onHide={noop} />
|
||||
<Modal.Body />
|
||||
<Modal.Dialog />
|
||||
<Modal.Footer />
|
||||
<Modal.Header />
|
||||
<Modal.Title />
|
||||
<ModalBody />
|
||||
<ModalDialog />
|
||||
<ModalFooter />
|
||||
@@ -169,6 +187,13 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<NavDropdown id="foo" title={<h4>Test</h4>} />
|
||||
<NavItem />
|
||||
<Navbar />
|
||||
<Navbar.Brand />
|
||||
<Navbar.Collapse />
|
||||
<Navbar.Header />
|
||||
<Navbar.Toggle />
|
||||
<Navbar.Link href="foo" />
|
||||
<Navbar.Text />
|
||||
<Navbar.Form />
|
||||
<NavbarBrand />
|
||||
<NavbarCollapse />
|
||||
<NavbarHeader />
|
||||
@@ -178,8 +203,15 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<PageHeader />
|
||||
<PageItem />
|
||||
<Pager />
|
||||
<Pager.Item />
|
||||
<PagerItem />
|
||||
<Pagination />
|
||||
<Pagination.Item />
|
||||
<Pagination.First />
|
||||
<Pagination.Last />
|
||||
<Pagination.Next />
|
||||
<Pagination.Prev />
|
||||
<Pagination.Ellipsis />
|
||||
<PaginationItem />
|
||||
<PaginationFirst />
|
||||
<PaginationLast />
|
||||
@@ -187,6 +219,12 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<PaginationPrev />
|
||||
<PaginationEllipsis />
|
||||
<Panel />
|
||||
<Panel.Heading />
|
||||
<Panel.Body />
|
||||
<Panel.Collapse />
|
||||
<Panel.Footer />
|
||||
<Panel.Title />
|
||||
<Panel.Toggle />
|
||||
<PanelHeading />
|
||||
<PanelBody />
|
||||
<PanelCollapse />
|
||||
@@ -203,6 +241,9 @@ export class ReactBootstrapIndividualComponentsTest extends React.Component {
|
||||
<SplitButton id="foo" title="bar" />
|
||||
<SplitToggle />
|
||||
<Tab />
|
||||
<Tab.Container />
|
||||
<Tab.Content />
|
||||
<Tab.Pane />
|
||||
<TabContainer />
|
||||
<TabContent />
|
||||
<TabPane />
|
||||
|
||||
Reference in New Issue
Block a user