question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'itemHeight' of undefined

See original GitHub issue

Version

0.9.17

Environment

react-native 0.37.0

Reproduction link

https://mobile.ant.design/components/picker-cn/

Steps to reproduce

使用 Picker 组件,在安卓中必现。

报错在编译后的文件 NativePicker.android.js 第 84 行,this 是个 undefined

if (this.itemHeight !== height || this.itemWidth !== width) {
                this.itemWidth = width;
                this.refs.indicator.setNativeProps({
                    style: [styles.indicator, {
                        top: height * 3,
                        height: height,
                        width: width
                    }]
                });
            }

What is expected?

和 iOS 相同效果

What is actually happening?

安卓出错


使用的官方 demo

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
silentcloudcommented, Jun 16, 2017

@cloudsafe @xwartz Sorry about this. please run rm -rf node_modules && npm i. Thanks

0reactions
xwartzcommented, Jun 16, 2017

@cloudsafeNativePicker.ios.js 的代码替换了 NativePicker.android.js,使用 RN 默认的了

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'item_name' of undefined
Chrome browser console shows error like Uncaught TypeError: Cannot read property 'newItem' of undefined I've noted my error lines as ...
Read more >
Angular @ViewChild Error 'Cannot read property nativeElement of ...
I am new to Angular and facing this issue. I want to check value for variable elementRef if its empty before data shown...
Read more >
[#QTBUG-31568] ComboBox / Menu: no scrolling available in the ...
... TypeError: Cannot read property 'height' of undefined After some ... error above doesn't appear readonly property int itemHeight: list.count > 0 ?...
Read more >
Collection-repeat, cannot read property 'isLetter' of undefined - ionic ...
Hi there, I have been attempting to follow the 'collection-repeat' tutorial from this codepen, and I have copied the syntax exactly.
Read more >
TypeError: Cannot read property 'height' of undefined
So sadly i have no idea when this error started. I've noticed i did an update with (YanFly's) - MV Plugin's., later this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found