mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 07:20:23 +00:00
[react-transition-group] Add types for config (#38770)
* [react-transition-group] Add types for config * [react-transition-group] Add test for changing config
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
export interface Config {
|
||||
disabled: boolean;
|
||||
}
|
||||
|
||||
declare const config: Config;
|
||||
export default config;
|
||||
+2
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Karol Janyst <https://github.com/LKay>
|
||||
// Epskampie <https://github.com/Epskampie>
|
||||
// Masafumi Koba <https://github.com/ybiquitous>
|
||||
// tu4mo <https://github.com/tu4mo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@@ -10,3 +11,4 @@ export { default as Transition } from './Transition';
|
||||
export { default as CSSTransition } from './CSSTransition';
|
||||
export { default as TransitionGroup } from './TransitionGroup';
|
||||
export { default as SwitchTransition } from './SwitchTransition';
|
||||
export { default as config } from './config';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as React from "react";
|
||||
import { UNMOUNTED, EXITED, ENTERING, ENTERED, EXITING, TransitionStatus } from "react-transition-group/Transition";
|
||||
import { modes } from "react-transition-group/SwitchTransition";
|
||||
import { Transition, CSSTransition, TransitionGroup, SwitchTransition } from "react-transition-group";
|
||||
import { Transition, CSSTransition, TransitionGroup, SwitchTransition, config } from "react-transition-group";
|
||||
|
||||
interface ContainerProps {
|
||||
theme: string;
|
||||
@@ -213,3 +213,5 @@ const Test: React.StatelessComponent = () => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
config.disabled = false;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"Transition.d.ts",
|
||||
"TransitionGroup.d.ts",
|
||||
"SwitchTransition.d.ts",
|
||||
"react-transition-group-tests.tsx"
|
||||
"react-transition-group-tests.tsx",
|
||||
"config.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user