Skip to content

Commit

Permalink
Revert useAnimation() as it no longer works in later versions
Browse files Browse the repository at this point in the history
  • Loading branch information
mtias committed Apr 14, 2023
1 parent 19224fb commit acb4287
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 19 deletions.
4 changes: 0 additions & 4 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

## Unreleased

### New Feature

- `Motion`: Expose `useAnimation` from framer motion package.

## 23.8.0 (2023-04-12)

### Internal
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/animation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@
export {
motion as __unstableMotion,
AnimatePresence as __unstableAnimatePresence,
useAnimation as __unstableUseAnimation,
} from 'framer-motion';
6 changes: 1 addition & 5 deletions packages/components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ export {
default as Animate,
getAnimateClassName as __unstableGetAnimateClassName,
} from './animate';
export {
__unstableMotion,
__unstableAnimatePresence,
__unstableUseAnimation,
} from './animation';
export { __unstableMotion, __unstableAnimatePresence } from './animation';
export { default as AnglePickerControl } from './angle-picker-control';
export {
default as Autocomplete,
Expand Down
10 changes: 1 addition & 9 deletions packages/edit-site/src/components/site-hub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import {
Button,
__unstableMotion as motion,
__unstableAnimatePresence as AnimatePresence,
__unstableUseAnimation as useAnimation,
__experimentalHStack as HStack,
} from '@wordpress/components';
import { useReducedMotion } from '@wordpress/compose';
import { __ } from '@wordpress/i18n';
import { store as blockEditorStore } from '@wordpress/block-editor';
import { store as coreStore } from '@wordpress/core-data';
import { decodeEntities } from '@wordpress/html-entities';
import { forwardRef, useEffect } from '@wordpress/element';
import { forwardRef } from '@wordpress/element';

/**
* Internal dependencies
Expand Down Expand Up @@ -58,18 +57,12 @@ const SiteHub = forwardRef( ( props, ref ) => {
[]
);

const controls = useAnimation();
useEffect( () => {
controls.set( { layout: true } );
}, [ controls ] );

return (
<motion.div
ref={ ref }
{ ...props }
className={ classnames( 'edit-site-site-hub', props.className ) }
initial={ false }
animate={ controls }
transition={ {
type: 'tween',
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
Expand All @@ -84,7 +77,6 @@ const SiteHub = forwardRef( ( props, ref ) => {
<motion.div
className="edit-site-site-hub__view-mode-toggle-container"
layout
animate={ controls }
transition={ {
type: 'tween',
duration: disableMotion ? 0 : HUB_ANIMATION_DURATION,
Expand Down

0 comments on commit acb4287

Please sign in to comment.