MCPcopy
hub / github.com/facebook/react / desiredSize

Method desiredSize

packages/react-devtools-timeline/src/view-base/View.js:147–153  ·  view source on GitHub ↗

* A size that can be used as a hint by layout functions. * * Implementations should typically return the intrinsic content size or a * size that fits all the view's content. * * The default implementation returns a size that fits all the view's * subviews. * * Can be overridd

()

Source from the content-addressed store, hash-verified

145 * Can be overridden by subclasses.
146 */
147 desiredSize(): Size | IntrinsicSize {
148 if (this._needsDisplay) {
149 this.layoutSubviews();
150 }
151 const frames = this.subviews.map(subview => subview.frame);
152 return unionOfRects(...frames).size;
153 }
154
155 /**
156 * Appends `view` to the list of this view's `subviews`.

Callers 3

drawMethod · 0.95
verticallyStackedLayoutFunction · 0.45
desiredHeightLayoutFunction · 0.45

Calls 3

layoutSubviewsMethod · 0.95
unionOfRectsFunction · 0.90
mapMethod · 0.65

Tested by

no test coverage detected