mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
c2b971d6d4
Summary:
Changelog: [internal]
There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size.
Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly.
Reviewed By: fkgozali
Differential Revision: D30402207
fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb
57 lines
1.3 KiB
Objective-C
57 lines
1.3 KiB
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "RCTConstants.h"
|
|
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
|
|
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
|
|
|
|
/*
|
|
* Preemptive View Allocation
|
|
*/
|
|
static BOOL RCTExperimentPreemptiveViewAllocationDisabled = NO;
|
|
|
|
BOOL RCTExperimentGetPreemptiveViewAllocationDisabled()
|
|
{
|
|
return RCTExperimentPreemptiveViewAllocationDisabled;
|
|
}
|
|
|
|
void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value)
|
|
{
|
|
RCTExperimentPreemptiveViewAllocationDisabled = value;
|
|
}
|
|
|
|
/*
|
|
* Initial maximum surface size
|
|
*/
|
|
static BOOL RCTInitialMaxSizeEnabled = NO;
|
|
|
|
BOOL RCTGetInitialMaxSizeEnabled()
|
|
{
|
|
return RCTInitialMaxSizeEnabled;
|
|
}
|
|
|
|
void RCTSetInitialMaxSizeEnabled(BOOL value)
|
|
{
|
|
RCTInitialMaxSizeEnabled = value;
|
|
}
|
|
|
|
/*
|
|
* Remove clipped subviews
|
|
*/
|
|
static BOOL RCTRemoveClippedSubviewsEnabled = NO;
|
|
|
|
BOOL RCTGetRemoveClippedSubviewsEnabled(void)
|
|
{
|
|
return RCTRemoveClippedSubviewsEnabled;
|
|
}
|
|
|
|
void RCTSetRemoveClippedSubviewsEnabled(BOOL value)
|
|
{
|
|
RCTRemoveClippedSubviewsEnabled = value;
|
|
}
|