Created
December 5, 2016 12:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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