File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Transition from 'react-overlays/lib/Transition' ;
33import domUtils from './utils/domUtils' ;
4+ import CustomPropTypes from './utils/CustomPropTypes' ;
5+ import deprecationWarning from './deprecationWarning' ;
46import createChainedFunction from './utils/createChainedFunction' ;
57
68let capitalize = str => str [ 0 ] . toUpperCase ( ) + str . substr ( 1 ) ;
@@ -140,6 +142,20 @@ Collapse.propTypes = {
140142 */
141143 timeout : React . PropTypes . number ,
142144
145+ /**
146+ * duration
147+ * @private
148+ */
149+ duration : CustomPropTypes . all ( [
150+ React . PropTypes . number ,
151+ ( props ) => {
152+ if ( props . duration != null ) {
153+ deprecationWarning ( 'Collapse `duration`' , 'the `timeout` prop' ) ;
154+ }
155+ return null ;
156+ }
157+ ] ) ,
158+
143159 /**
144160 * Callback fired before the component expands
145161 */
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Transition from 'react-overlays/lib/Transition' ;
3+ import CustomPropTypes from './utils/CustomPropTypes' ;
4+ import deprecationWarning from './deprecationWarning' ;
35
46class Fade extends React . Component {
57 render ( ) {
8+ let timeout = this . props . timeout || this . props . duration ;
9+
610 return (
711 < Transition
812 { ...this . props }
13+ timeout = { timeout }
914 className = 'fade'
1015 enteredClassName = 'in'
1116 enteringClassName = 'in'
@@ -18,7 +23,6 @@ class Fade extends React.Component {
1823
1924// Explicitly copied from Transition for doc generation.
2025// TODO: Remove duplication once #977 is resolved.
21-
2226Fade . propTypes = {
2327 /**
2428 * Show the component; triggers the fade in or fade out animation
@@ -43,6 +47,20 @@ Fade.propTypes = {
4347 */
4448 timeout : React . PropTypes . number ,
4549
50+ /**
51+ * duration
52+ * @private
53+ */
54+ duration : CustomPropTypes . all ( [
55+ React . PropTypes . number ,
56+ ( props ) => {
57+ if ( props . duration != null ) {
58+ deprecationWarning ( 'Fade `duration`' , 'the `timeout` prop' ) ;
59+ }
60+ return null ;
61+ }
62+ ] ) ,
63+
4664 /**
4765 * Callback fired before the component fades in
4866 */
You can’t perform that action at this time.
0 commit comments