From 03a6a61d0f7ac81bb9bf1a2e88fa6c5645e223f7 Mon Sep 17 00:00:00 2001 From: jquense Date: Mon, 17 Aug 2015 16:45:43 -0400 Subject: [PATCH] [changed] deprecated the Transition duration prop --- src/Collapse.js | 16 ++++++++++++++++ src/Fade.js | 20 +++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) 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 */