Ant-design-mobile: Cannot read property 'itemHeight' of undefined

Created on 15 Jun 2017  ·  5Comments  ·  Source: ant-design/ant-design-mobile

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

bug react native

Most helpful comment

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

All 5 comments

我的也是提示这个,上午还好好的。下午就莫名其妙的出了这个问题。

@cloudsafe 我现在是直接改代码修复的

@xwartz 你是怎么修改的?共享下可以不。很头疼,所有表单用Picker的都报错,工作进行不下去了都。

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

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

Was this page helpful?
0 / 5 - 0 ratings