Skip to content

Commit

Permalink
Deprecate Animate component
Browse files Browse the repository at this point in the history
Suggested here:
#26965 (comment)
  • Loading branch information
sirreal committed Nov 18, 2020
1 parent 4d18b77 commit b07338d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/components/src/animate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
*/
import classnames from 'classnames';

/**
* WordPress dependencies
*/
import deprecated from '@wordpress/deprecated';

function getDefaultOrigin( type ) {
return type === 'appear' ? 'top' : 'left';
}
Expand All @@ -29,6 +34,10 @@ export function useAnimate( { type, origin = getDefaultOrigin( type ) } ) {
}

export default function Animate( { type, options = {}, children } ) {
deprecated( 'Animate component', {
version: '9.6',
alternative: 'useAnimate hook',
} );
return children( {
className: useAnimate( { type, ...options } ),
} );
Expand Down

0 comments on commit b07338d

Please sign in to comment.