Skip to content

Commit 2edc7d2

Browse files
committed
Merge branch 'master' of https://github.com/didi/mpx
2 parents 88c1308 + 98f81e7 commit 2edc7d2

File tree

1 file changed

+3
-2
lines changed
  • packages/api-proxy/src/platform/api/create-selector-query

1 file changed

+3
-2
lines changed

packages/api-proxy/src/platform/api/create-selector-query/rnNodesRef.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ const wrapFn = (fn) => {
4141
const getMeasureProps = (measureProps = []) => {
4242
return wrapFn((nodeInstance, resolve) => {
4343
const nodeRef = nodeInstance.nodeRef.current
44-
const navigation = getFocusedNavigation()
44+
const navigation = getFocusedNavigation() || {}
4545
setTimeout(() => {
4646
nodeRef.measure(function (x, y, width, height, pageX, pageY) {
47-
pageY = pageY - navigation.layout.top
47+
const layout = navigation.layout || {}
48+
pageY = pageY - (layout.top || 0)
4849
const rectAndSize = {
4950
width,
5051
height,

0 commit comments

Comments
 (0)