Subscribing to events
import React from 'react'
const EmptyModal = ({ modal: { addListener }) => {
const modalListener = React.useRef()
const handleAnimation = (value) => {
console.log('Modal animatedValue:', value)
}
React.useEffect(() => {
modalListener.current = addListener('onAnimate', handleAnimation)
return () => {
modalListener.current?.remove()
}
}, [])
return (
//...
)
}
export default EmptyModalLast updated