Skip to content

Instantly share code, notes, and snippets.

@andrewkslv
Created December 5, 2016 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewkslv/39d09f10faf2db6eae6d48890b1981cb to your computer and use it in GitHub Desktop.
Save andrewkslv/39d09f10faf2db6eae6d48890b1981cb to your computer and use it in GitHub Desktop.
How to find x,y position / measure height of a component in React native
import { findNodeHandle } from 'react-native';
const RCTUIManager = require('NativeModules').UIManager;
RCTUIManager.measure(findNodeHandle(this.refs.myRef), (x, y, width, height, pageX, pageY) => {
// Got me some dimensions
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment