-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[WIP][Not for merge] Support Inspector in Fiber #12421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,6 @@ | |
'use strict'; | ||
|
||
var Dimensions = require('Dimensions'); | ||
var InspectorUtils = require('InspectorUtils'); | ||
var React = require('React'); | ||
var StyleSheet = require('StyleSheet'); | ||
var UIManager = require('UIManager'); | ||
|
@@ -32,7 +31,7 @@ class InspectorOverlay extends React.Component { | |
style?: any, | ||
}, | ||
inspectedViewTag?: number, | ||
onTouchInstance: Function, | ||
onTouchViewTag: (tag: number) => void, | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined (too few arguments, expected default/rest parameters) This type is incompatible with number There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. undefined (too few arguments, expected default/rest parameters) This type is incompatible with object type |
||
|
||
static propTypes = { | ||
|
@@ -41,7 +40,7 @@ class InspectorOverlay extends React.Component { | |
style: PropTypes.any, | ||
}), | ||
inspectedViewTag: PropTypes.number, | ||
onTouchInstance: PropTypes.func.isRequired, | ||
onTouchViewTag: PropTypes.func.isRequired, | ||
}; | ||
|
||
findViewForTouchEvent = (e: EventLike) => { | ||
|
@@ -50,11 +49,7 @@ class InspectorOverlay extends React.Component { | |
this.props.inspectedViewTag, | ||
[locationX, locationY], | ||
(nativeViewTag, left, top, width, height) => { | ||
var instance = InspectorUtils.findInstanceByNativeTag(nativeViewTag); | ||
if (!instance) { | ||
return; | ||
} | ||
this.props.onTouchInstance(instance, {left, top, width, height}, locationY); | ||
this.props.onTouchViewTag(nativeViewTag, {left, top, width, height}, locationY); | ||
} | ||
); | ||
}; | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we centralize the place we read this to a single place since it is kind of a hack? Even if it is a function call. Also, can we avoid
window
? It's lame that we have to add a global window object in RN.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single place for reading the global object, is that what you mean? Like getHook()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea