+ Click to rerender, the box will fill the right side of the screen using position absolute. +
+ +The element renders inline
+ > + ); + }, +}; diff --git a/packages/react-animation/src/useFlip/useFlip.ts b/packages/react-animation/src/useFlip/useFlip.ts new file mode 100644 index 0000000..0400221 --- /dev/null +++ b/packages/react-animation/src/useFlip/useFlip.ts @@ -0,0 +1,26 @@ +import { unref, type Unreffable } from '@mediamonks/react-hooks'; +import gsap from 'gsap'; +import Flip from 'gsap/Flip'; +import { useEffect, useRef, type MutableRefObject } from 'react'; + +gsap.registerPlugin(Flip); + +export function useFlip( + ref: Unreffable