rilyu / teaset

A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.
MIT License
2.95k stars 482 forks source link

我想知道SegmentedView里是如何实现不重新调用子view的render方法的 #431

Open wanglaohushiwo opened 4 years ago

wanglaohushiwo commented 4 years ago

看segmentedview源码看了一遍,本来以为会在SegmentedView.Sheet的子view里重写shouldComponentUpdate方法(当opatity变化时不更新),但是却没有重写shouldComponentUpdate方法

wanglaohushiwo commented 4 years ago

找到原因了,是这个原因导致的,大家可以去查this.props.children not re-rendered on parent state change