Skip to content

Commit

Permalink
fix(types): Toast component (#4246)
Browse files Browse the repository at this point in the history
* fix(types): Toast component

* fix: types
  • Loading branch information
mxschmitt committed Aug 14, 2019
1 parent 1b5b09d commit c30e131
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/components/Toast.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import * as React from 'react';
import ToastBody from './ToastBody';
import ToastHeader from './ToastHeader';

import { BsPrefixComponent, TransitionCallbacks } from './helpers';
import { BsPrefixComponent } from './helpers';

export interface ToastProps extends TransitionCallbacks {
export interface ToastProps {
animation?: boolean;
autohide?: boolean;
delay?: number;
onClose?: () => void;
show: boolean;
transition: boolean | React.ElementType;
show?: boolean;
transition?: boolean | React.ElementType;
}

declare class Toast extends BsPrefixComponent<'div', ToastProps> {
Expand Down
10 changes: 10 additions & 0 deletions types/simple.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
Tab,
ToggleButtonGroup,
ToggleButton,
Toast,
} from 'react-bootstrap';

<Alert ref={React.createRef<HTMLDivElement>()} dismissible>
Expand Down Expand Up @@ -325,6 +326,15 @@ import {
<span>Something Inside</span>
</Spinner>;

<Toast>
<Toast.Header>
<img src="holder.js/20x20?text=%20" className="rounded mr-2" alt="" />
<strong className="mr-auto">Bootstrap</strong>
<small>11 mins ago</small>
</Toast.Header>
<Toast.Body>Hello, world! This is a toast message.</Toast.Body>
</Toast>;

<Pagination>
<Pagination.First />
<Pagination.Prev />
Expand Down

0 comments on commit c30e131

Please sign in to comment.