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.

(measure) method cannot be used on RN side!

See original GitHub issue

Description

When I use the measure function like that :

  const style = useAnimatedStyle(() => {
    const measured = measure(aref);

    return {
      width: measured.width,
      height: measured.height,
    };
  });

I get the error message : (measure) method cannot be used on RN side!

Screenshots

Steps To Reproduce

Expected behavior

Actual behavior

I’d like for this measure to work

Snack or minimal code example

Package versions

  • React:
  • React Native:
  • React Native Reanimated: alpha 5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:8
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

9reactions
a-eidcommented, Sep 1, 2020

having the same issue.

3reactions
a-eidcommented, Sep 1, 2020

@terrysahaidak this doc example doesn’t work and raises the above error.

const Comp = () => {
  const aref = useAnimatedRef();

  useDerivedValue(() => {
    const measured = measure(aref);
    // ...
  });

  return <View ref={aref} />;
};
``
Read more comments on GitHub >

github_iconTop Results From Across the Web

measure | React Native Reanimated - Software Mansion
Determines the location on screen, width, and height in the viewport of the given view synchronously and returns an object with measured dimensions...
Read more >
React Native: Getting the position of an element - Stack Overflow
React Native provides a .measure(...) method which takes a callback and calls it with the offsets and width/height of a component: myComponent.measure( (fx ......
Read more >
Measures with Reanimated 2 : r/reactnative - Reddit
I.e., if the list items themselves did not have a defined height in advance. Is this use case doable using measure?
Read more >
Use of Restraints and Safety Devices: NCLEX-RN
Commonly Used Terms Associated With Restraints and Restraint Use ... however, it is not often possible to prevent the use of restraints and...
Read more >
NG Tube Placement | How to Check Nasogastric Tube ...
Methods Used to Check Correct Placement of Nasogastric (NG) Tube ... side under the diaphragm. Syringe test – This method is not uses...
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