mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #26097 from abruzzihraig/master
[react-transition-group] missing props definition of property 'component' in TransitionGroup
This commit is contained in:
@@ -14,6 +14,7 @@ declare namespace TransitionGroup {
|
||||
(IntrinsicTransitionGroupProps<T> & JSX.IntrinsicElements[T]) | (ComponentTransitionGroupProps<V>) & {
|
||||
children?: ReactElement<TransitionProps> | Array<ReactElement<TransitionProps>>;
|
||||
childFactory?(child: ReactElement<any>): ReactElement<any>;
|
||||
[prop: string]: any;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,19 @@ import Transition, { UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING } from "react
|
||||
import TransitionGroup = require("react-transition-group/TransitionGroup");
|
||||
import Components = require("react-transition-group");
|
||||
|
||||
interface ContainerProps {
|
||||
theme: string;
|
||||
children?: Element[];
|
||||
}
|
||||
|
||||
const Container: React.StatelessComponent<ContainerProps> = (props: ContainerProps) => {
|
||||
return (
|
||||
<div data-theme={props.theme}>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const Test: React.StatelessComponent = () => {
|
||||
function handleEnter(node: HTMLElement, isAppearing: boolean) {}
|
||||
|
||||
@@ -15,7 +28,8 @@ const Test: React.StatelessComponent = () => {
|
||||
|
||||
return (
|
||||
<TransitionGroup
|
||||
component="ul"
|
||||
component={Container}
|
||||
theme="test"
|
||||
className="animated-list"
|
||||
childFactory={ (child: React.ReactElement<any>) => child }
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user