Hacker News new | ask | show | jobs
by leodriesch 1297 days ago
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.