How to use the framer-motion.useSpring function in framer-motion

To help you get started, we’ve selected a few framer-motion examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github madebymany / front-end-london / src / components / NavModal / index.js View on Github external
const MobileModal = ({ tickets, open, setOpen }) => {
  const [size, setSize] = useState("100%")
  const pathPos = useSpring(0, { springConfig })
  const path = useTransform(pathPos, value =>
    interpolator(transform(value, [0, 1], [0, 1]))
  )
  useEffect(() => {
    const timer = setTimeout(
      () => {
        pathPos.set(open ? 1 : 0)
      },
      open ? 400 : 500
    )

    return () => clearTimeout(timer)
  }, [open, pathPos])

  useEffect(() => {
    const getSize = debounce(() => {