Commit 075a72c4 authored by Mickaël Bourgier's avatar Mickaël Bourgier
Browse files

[Slide] Deprecate default prop `appear`

parent d2cb2a34
......@@ -55,7 +55,11 @@ class Drawer extends Component {
/>
</Fade>
)}
<Slide in={open} direction={position === 'left' ? 'right' : 'left'}>
<Slide
appear={false}
in={open}
direction={position === 'left' ? 'right' : 'left'}
>
<Paper
{...otherProps}
className={classNames(
......
......@@ -191,6 +191,7 @@ class Slide extends Component {
render() {
const {
appear = false,
children,
direction,
duration,
......@@ -223,6 +224,7 @@ class Slide extends Component {
return (
<EventListener target='window' onResize={this.handleResize}>
<Transition
appear={appear}
onEnter={this.handleEnter}
onEntering={this.handleEntering}
onExit={this.handleExit}
......@@ -248,7 +250,20 @@ Slide.propTypes = {
/**
* Déclenche une transition lorsque le composant est monté
*/
appear: PropTypes.bool,
appear: (props, propName, componentName, location, propFullName) => {
const componentNameSafe = componentName || '<<anonymous>>';
const propFullNameSafe = propFullName || propName;
if (typeof props[propName] === 'undefined') {
return new Error(
`The default value of ${location} \`${propFullNameSafe}\` of ` +
`\`${componentNameSafe}\` and will change to \`true\` in v2.0. ` +
`Explicitly set the value to turn off this warning.`
);
}
return null;
},
/**
* Contenu du composant, voir la documentation de
......@@ -336,7 +351,6 @@ Slide.propTypes = {
};
Slide.defaultProps = {
appear: false,
direction: 'up',
enableEnterTransition: true,
enableExitTransition: true,
......
......@@ -101,6 +101,7 @@ class DynamicProps extends Component {
</div>
<div className={classes.wrapper}>
<Slide
appear={false}
direction={direction}
duration={{
enter: durationEnter,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment