Skip to content

Commit

Permalink
Remove RCTViewConfigEventValidAttributesDisabled
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

Codemod-bot already hardcoded this to false a while back, so cleaning up the code related to it.

Reviewed By: RSNara

Differential Revision: D41615378

fbshipit-source-id: 7b62b20b8e25f0a06d207b2457d6caf9ad5c695e
  • Loading branch information
javache authored and facebook-github-bot committed Dec 2, 2022
1 parent d966696 commit 1452a55
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 36 deletions.
5 changes: 1 addition & 4 deletions Libraries/NativeComponent/ViewConfigIgnore.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ export function DynamicallyInjectedByGestureHandler<T: {...}>(object: T): T {
export function ConditionallyIgnoredEventHandlers<T: {[name: string]: true}>(
value: T,
): T | void {
if (
Platform.OS === 'ios' &&
!(global.RN$ViewConfigEventValidAttributesDisabled === true)
) {
if (Platform.OS === 'ios') {
return value;
}
return undefined;
Expand Down
5 changes: 0 additions & 5 deletions React/Base/RCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ RCT_EXTERN void RCTEnableTurboModuleEagerInit(BOOL enabled);
RCT_EXTERN BOOL RCTTurboModuleManagerDelegateLockingDisabled(void);
RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled);

// Turn off validAttribute: entries inside ViewConfigs for events
// TODO(109509380): Remove this gating
RCT_EXTERN BOOL RCTViewConfigEventValidAttributesDisabled(void);
RCT_EXTERN void RCTDisableViewConfigEventValidAttributes(BOOL disabled);

typedef enum {
kRCTGlobalScope,
kRCTGlobalScopeUsingRetainJSCallback,
Expand Down
12 changes: 0 additions & 12 deletions React/Base/RCTBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,18 +120,6 @@ void RCTDisableTurboModuleManagerDelegateLocking(BOOL disabled)
turboModuleManagerDelegateLockingDisabled = disabled;
}

// Turn off TurboModule delegate locking
static BOOL viewConfigEventValidAttributesDisabled = NO;
BOOL RCTViewConfigEventValidAttributesDisabled(void)
{
return viewConfigEventValidAttributesDisabled;
}

void RCTDisableViewConfigEventValidAttributes(BOOL disabled)
{
viewConfigEventValidAttributesDisabled = disabled;
}

@interface RCTBridge () <RCTReloadListener>
@end

Expand Down
18 changes: 3 additions & 15 deletions React/Views/RCTComponentData.m
Original file line number Diff line number Diff line change
Expand Up @@ -431,25 +431,13 @@ - (void)setProps:(NSDictionary<NSString *, id> *)props forShadowView:(RCTShadowV

if ([type isEqualToString:@"RCTBubblingEventBlock"]) {
[bubblingEvents addObject:RCTNormalizeInputEventName(name)];

// TODO(109509380): Remove this gating
if (!RCTViewConfigEventValidAttributesDisabled()) {
propTypes[name] = @"BOOL";
}
propTypes[name] = @"BOOL";
} else if ([type isEqualToString:@"RCTCapturingEventBlock"]) {
[capturingEvents addObject:RCTNormalizeInputEventName(name)];

// TODO(109509380): Remove this gating
if (!RCTViewConfigEventValidAttributesDisabled()) {
propTypes[name] = @"BOOL";
}
propTypes[name] = @"BOOL";
} else if ([type isEqualToString:@"RCTDirectEventBlock"]) {
[directEvents addObject:RCTNormalizeInputEventName(name)];

// TODO(109509380): Remove this gating
if (!RCTViewConfigEventValidAttributesDisabled()) {
propTypes[name] = @"BOOL";
}
propTypes[name] = @"BOOL";
} else {
propTypes[name] = type;
}
Expand Down

0 comments on commit 1452a55

Please sign in to comment.