MLH-Fellowship / scheduling-profiler-prototype

Custom profiler prototype for React's concurrent mode
https://react-scheduling-profiler.vercel.app/
6 stars 0 forks source link

Views: Support subviews in View class #95

Closed taneliang closed 4 years ago

taneliang commented 4 years ago

Currently, any view that wants to support subviews has to manually override a bunch of functions. This is error-prone. We should follow UIView's approach and support subviews in View directly. The only con is that it is harder to enforce that a view can only have 1 contentView, which is a requirement of HorizontalPanAndZoomView and VerticalScrollView.

Layout views should also forward subviews' desiredSize. This may require splitting of layoutSubviews and draw.