Skip to content

Commit

Permalink
Convert Inspector to call ref.measure
Browse files Browse the repository at this point in the history
Summary:
`node` is passed to us from react devtools. We can call .measure on that directly instead of using findNodeHandle and UIManager. This makes this call compatible with Fabric.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D19152052

fbshipit-source-id: 05ab6d55f3a79221d99289f0341eb25352b96899
  • Loading branch information
elicwhite authored and facebook-github-bot committed Dec 18, 2019
1 parent 636f48d commit fa78a96
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Libraries/Inspector/Inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const React = require('react');
const ReactNative = require('../Renderer/shims/ReactNative');
const StyleSheet = require('../StyleSheet/StyleSheet');
const Touchable = require('../Components/Touchable/Touchable');
const UIManager = require('../ReactNative/UIManager');
const View = require('../Components/View/View');

const invariant = require('invariant');
Expand Down Expand Up @@ -153,11 +152,7 @@ class Inspector extends React.Component<
_onAgentShowNativeHighlight = node => {
clearTimeout(this._hideTimeoutID);

if (typeof node !== 'number') {
node = ReactNative.findNodeHandle(node);
}

UIManager.measure(node, (x, y, width, height, left, top) => {
node.measure((x, y, width, height, left, top) => {
this.setState({
hierarchy: [],
inspected: {
Expand Down

0 comments on commit fa78a96

Please sign in to comment.