question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] Collect motion element dimensions

See original GitHub issue

Hello 👋

I’m working on a button to input animation (codesandbox) and I need to measure motion elements when the component mounts using useLayoutEffect to prevent flashing and animating on load. For some reason, ref.current is not available when the hook fires. I’m assuming because motion needs to know about it? Is there any way to grab the dimensions before the first paint? I appreciate any help 🙏.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
mattgperrycommented, Nov 1, 2019

That is a fantastic idea

0reactions
souporseriouscommented, Oct 31, 2019

Not to get off-topic, but maybe a first-class way to access dimensions could help? I know you need to do measurements in certain use-cases like FLIP, it might be nice to expose a hook to read dimensions at the same time framer does to save from having to read from the DOM twice.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chapter 3 KINEMATICS IN TWO DIMENSIONS PREVIEW
Two-dimensional motion includes objects which are moving in two directions at the same time, such as a projectile, which has both horizontal and...
Read more >
Properties of Periodic Motion - The Physics Classroom
The measurements were based upon readings of a position-time graph. The data on the graph was collected by a motion detector that was...
Read more >
Understanding Formal Analysis - Getty Center
It is one-dimensional and can vary in width, direction, and length. Lines often define the edges of a form. Lines can be horizontal,...
Read more >
Motion Graphics Templates - Frequently Asked Questions
Everything you need to know about Motion Graphics templates for Premiere Pro. We answer all the FAQs on the new MOGRT file type!...
Read more >
6 Ways to Motion Track in After Effects
What can you use motion tracking for? · Stabilize motion by utilizing tracking data. · Add elements such as text or solids to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found