News for hackers. Stuff that matters.
Re:Framer's Magic Motion by Julien_r2 on Tuesday December 06, 2022 @12:08AM (#33876163)
Very well explained, with nice little animations to toggle on the way !

For those copying/getting inspired by the code, don't forget to add the missing empty-array for the useLayoutEffet dependency param.

Re:Framer's Magic Motion by leodriesch on Tuesday December 06, 2022 @02:56AM (#33876968)
That would measure the component only on mount, so it would not notice if it’s layout changed.

You need to run it without the dependency array or add all layout-changing props and state to it.