diff --git a/src/Collapse.js b/src/Collapse.js index e38e3fcb0c..cc2bb5b407 100644 --- a/src/Collapse.js +++ b/src/Collapse.js @@ -1,6 +1,8 @@ import React from 'react'; import Transition from 'react-overlays/lib/Transition'; import domUtils from './utils/domUtils'; +import CustomPropTypes from './utils/CustomPropTypes'; +import deprecationWarning from './deprecationWarning'; import createChainedFunction from './utils/createChainedFunction'; let capitalize = str => str[0].toUpperCase() + str.substr(1); @@ -140,6 +142,20 @@ Collapse.propTypes = { */ timeout: React.PropTypes.number, + /** + * duration + * @private + */ + duration: CustomPropTypes.all([ + React.PropTypes.number, + (props)=> { + if (props.duration != null){ + deprecationWarning('Collapse `duration`', 'the `timeout` prop'); + } + return null; + } + ]), + /** * Callback fired before the component expands */ diff --git a/src/Fade.js b/src/Fade.js index a707ea386b..8cc5c761e4 100644 --- a/src/Fade.js +++ b/src/Fade.js @@ -1,11 +1,16 @@ import React from 'react'; import Transition from 'react-overlays/lib/Transition'; +import CustomPropTypes from './utils/CustomPropTypes'; +import deprecationWarning from './deprecationWarning'; class Fade extends React.Component { render() { + let timeout = this.props.timeout || this.props.duration; + return ( { + if (props.duration != null){ + deprecationWarning('Fade `duration`', 'the `timeout` prop'); + } + return null; + } + ]), + /** * Callback fired before the component fades in */