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.
For those copying/getting inspired by the code, don't forget to add the missing empty-array for the useLayoutEffet dependency param.