Skip to content
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

Cannot read property 'props' of undefined; [Component] Lifetime Method Error @ npm/@areslabs/wx-react-native/wxComponents/WXFlatList/index#(anonymous) TypeError: Cannot read property 'props' of undefined #47

Closed
yatessss opened this issue Jan 7, 2020 · 5 comments

Comments

@yatessss
Copy link

yatessss commented Jan 7, 2020

A跳转到B页面,B页面setWxInstByUUID一个名为a000000Q的对象,B返回A页面时,B页面调用removeUUID移除了a000000Q对象,单移除后又调用了getWxInstByUUID(a000000Q),因为innerMap[key]为undefined所以报错,这里可以innerMap[key] || {} 做一下保护。为何在移除该uuid后还会get一次

@yatessss
Copy link
Author

yatessss commented Jan 7, 2020

复现可以用Todo demo,复制一份Index页面命名为index2,从index跳到index2,再返回index就可以复现该问题,望可以解答疑惑。

@ykforerlang
Copy link
Member

我明天看下

@ykforerlang
Copy link
Member

ykforerlang commented Jan 8, 2020

@yatessss 修复了,把node_modules yarn.lock/package-lock.json 文件删除,重新安装一下依赖就可以了。

移除后重新调用的原因是: 移除调用的代码instanceManager.removeUUID(this.data.diuu), 而每次调用 this.data的时候,会在data里面注入一些其他数据,所以会getReactComp。 这个bug只会在FlatList, SectionList两个组件销毁的时候发生

@yatessss
Copy link
Author

yatessss commented Jan 8, 2020

@ykforerlang 多谢。有没有具体的commit,想了解一下修复的过程,多谢啦

@ykforerlang
Copy link
Member

commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants