Skip to main content

How to create resize event

create your app

import { gsap } from 'gsap'
import { useResize } from 'rege/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 'rege/react'

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