Skip to main content

How to create resize event

create your app

import { gsap } from 'gsap'
import { useResize } from 'reev/gesture/resize/react'

export const App = () => {
const { ref } = useResize(console.log)
return <span ref={ref} style={style} />
}

with Resize component

You can use shorthands Resize component

import { Resize } from 'reev/gesture/resize/react'

export const App2 = () => {
return <Resize key={console.log}>{({ ref }) => <span ref={ref} style={style} />}</Resize>
}