Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "TrueSheetContentViewShadowNode.h"

#include <folly/ScopeGuard.h>
#include <react/renderer/components/view/conversions.h>
#include <react/renderer/core/ComponentDescriptor.h>
#include <react/renderer/core/LayoutConstraints.h>
Expand Down Expand Up @@ -95,7 +94,12 @@ void TrueSheetContentViewShadowNode::updateNaturalHeightIfNeeded(const LayoutCon
if (contentChanged_ || !measurement_ || !(measurement_->constraints == constraints) ||
!(measurement_->context == measurementContext) || measurement_->errata != errata) {
gIsMeasuringNaturalHeight = true;
auto restoreMeasurement = folly::makeGuard([] { gIsMeasuringNaturalHeight = false; });
// Not folly::makeGuard: its terminate() isn't linked into RN < 0.86 on Android.
struct RestoreMeasurement {
~RestoreMeasurement() {
gIsMeasuringNaturalHeight = false;
}
} restoreMeasurement;
auto measurementNode =
measurement_ ? cloneForMeasurement(*this, *measurementSourceChildren_, measurement_->root->getChildren())
: cloneForMeasurement(*this, {}, {});
Expand Down
Loading