@@ -10,105 +10,6 @@ import { classNamesShape } from './utils/PropTypes';
1010const addClass = ( node , classes ) => node && classes && classes . split ( ' ' ) . forEach ( c => addOneClass ( node , c ) ) ;
1111const removeClass = ( node , classes ) => node && classes && classes . split ( ' ' ) . forEach ( c => removeOneClass ( node , c ) ) ;
1212
13- const propTypes = {
14- ...Transition . propTypes ,
15-
16- /**
17- * The animation classNames applied to the component as it enters, exits or has finished the transition.
18- * A single name can be provided and it will be suffixed for each stage: e.g.
19- *
20- * `classNames="fade"` applies `fade-enter`, `fade-enter-active`, `fade-enter-done`,
21- * `fade-exit`, `fade-exit-active`, `fade-exit-done`, `fade-appear`, and `fade-appear-active`.
22- * Each individual classNames can also be specified independently like:
23- *
24- * ```js
25- * classNames={{
26- * appear: 'my-appear',
27- * appearActive: 'my-active-appear',
28- * enter: 'my-enter',
29- * enterActive: 'my-active-enter',
30- * enterDone: 'my-done-enter',
31- * exit: 'my-exit',
32- * exitActive: 'my-active-exit',
33- * exitDone: 'my-done-exit',
34- * }}
35- * ```
36- *
37- * If you want to set these classes using CSS Modules:
38- *
39- * ```js
40- * import styles from './styles.css';
41- * ```
42- *
43- * you might want to use camelCase in your CSS file, that way could simply spread
44- * them instead of listing them one by one:
45- *
46- * ```js
47- * classNames={{ ...styles }}
48- * ```
49- *
50- * @type {string | {
51- * appear?: string,
52- * appearActive?: string,
53- * enter?: string,
54- * enterActive?: string,
55- * enterDone?: string,
56- * exit?: string,
57- * exitActive?: string,
58- * exitDone?: string,
59- * }}
60- */
61- classNames : classNamesShape ,
62-
63- /**
64- * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
65- * applied.
66- *
67- * @type Function(node: HtmlElement, isAppearing: bool)
68- */
69- onEnter : PropTypes . func ,
70-
71- /**
72- * A `<Transition>` callback fired immediately after the 'enter-active' or
73- * 'appear-active' class is applied.
74- *
75- * @type Function(node: HtmlElement, isAppearing: bool)
76- */
77- onEntering : PropTypes . func ,
78-
79- /**
80- * A `<Transition>` callback fired immediately after the 'enter' or
81- * 'appear' classes are **removed** and the `done` class is added to the DOM node.
82- *
83- * @type Function(node: HtmlElement, isAppearing: bool)
84- */
85- onEntered : PropTypes . func ,
86-
87-
88- /**
89- * A `<Transition>` callback fired immediately after the 'exit' class is
90- * applied.
91- *
92- * @type Function(node: HtmlElement)
93- */
94- onExit : PropTypes . func ,
95-
96- /**
97- * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
98- *
99- * @type Function(node: HtmlElement)
100- */
101- onExiting : PropTypes . func ,
102-
103- /**
104- * A `<Transition>` callback fired immediately after the 'exit' classes
105- * are **removed** and the `exit-done` class is added to the DOM node.
106- *
107- * @type Function(node: HtmlElement)
108- */
109- onExited : PropTypes . func ,
110- } ;
111-
11213/**
11314 * A `Transition` component using CSS transitions and animations.
11415 * It's inspired by the excellent [ng-animate](http://www.nganimate.org/) library.
@@ -246,6 +147,103 @@ class CSSTransition extends React.Component {
246147 }
247148}
248149
249- CSSTransition . propTypes = propTypes ;
150+ CSSTransition . propTypes = {
151+ ...Transition . propTypes ,
152+
153+ /**
154+ * The animation classNames applied to the component as it enters, exits or has finished the transition.
155+ * A single name can be provided and it will be suffixed for each stage: e.g.
156+ *
157+ * `classNames="fade"` applies `fade-enter`, `fade-enter-active`, `fade-enter-done`,
158+ * `fade-exit`, `fade-exit-active`, `fade-exit-done`, `fade-appear`, and `fade-appear-active`.
159+ * Each individual classNames can also be specified independently like:
160+ *
161+ * ```js
162+ * classNames={{
163+ * appear: 'my-appear',
164+ * appearActive: 'my-active-appear',
165+ * enter: 'my-enter',
166+ * enterActive: 'my-active-enter',
167+ * enterDone: 'my-done-enter',
168+ * exit: 'my-exit',
169+ * exitActive: 'my-active-exit',
170+ * exitDone: 'my-done-exit',
171+ * }}
172+ * ```
173+ *
174+ * If you want to set these classes using CSS Modules:
175+ *
176+ * ```js
177+ * import styles from './styles.css';
178+ * ```
179+ *
180+ * you might want to use camelCase in your CSS file, that way could simply spread
181+ * them instead of listing them one by one:
182+ *
183+ * ```js
184+ * classNames={{ ...styles }}
185+ * ```
186+ *
187+ * @type {string | {
188+ * appear?: string,
189+ * appearActive?: string,
190+ * enter?: string,
191+ * enterActive?: string,
192+ * enterDone?: string,
193+ * exit?: string,
194+ * exitActive?: string,
195+ * exitDone?: string,
196+ * }}
197+ */
198+ classNames : classNamesShape ,
199+
200+ /**
201+ * A `<Transition>` callback fired immediately after the 'enter' or 'appear' class is
202+ * applied.
203+ *
204+ * @type Function(node: HtmlElement, isAppearing: bool)
205+ */
206+ onEnter : PropTypes . func ,
207+
208+ /**
209+ * A `<Transition>` callback fired immediately after the 'enter-active' or
210+ * 'appear-active' class is applied.
211+ *
212+ * @type Function(node: HtmlElement, isAppearing: bool)
213+ */
214+ onEntering : PropTypes . func ,
215+
216+ /**
217+ * A `<Transition>` callback fired immediately after the 'enter' or
218+ * 'appear' classes are **removed** and the `done` class is added to the DOM node.
219+ *
220+ * @type Function(node: HtmlElement, isAppearing: bool)
221+ */
222+ onEntered : PropTypes . func ,
223+
224+
225+ /**
226+ * A `<Transition>` callback fired immediately after the 'exit' class is
227+ * applied.
228+ *
229+ * @type Function(node: HtmlElement)
230+ */
231+ onExit : PropTypes . func ,
232+
233+ /**
234+ * A `<Transition>` callback fired immediately after the 'exit-active' is applied.
235+ *
236+ * @type Function(node: HtmlElement)
237+ */
238+ onExiting : PropTypes . func ,
239+
240+ /**
241+ * A `<Transition>` callback fired immediately after the 'exit' classes
242+ * are **removed** and the `exit-done` class is added to the DOM node.
243+ *
244+ * @type Function(node: HtmlElement)
245+ */
246+ onExited : PropTypes . func ,
247+ } ;
250248
251249export default CSSTransition
0 commit comments