Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ flow-typed/
packages/react-native/flow/

[options]
experimental.tslib_syntax=true
builtin_lib=core-only

emoji=true
Expand Down
10 changes: 4 additions & 6 deletions packages/react-native/Libraries/StyleSheet/splitLayoutProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@

import type {ViewStyle} from './StyleSheetTypes';

type MutableViewStyle = {-readonly [K in keyof ViewStyle]: ViewStyle[K]};

export default function splitLayoutProps(props: ?ViewStyle): {
outer: ?ViewStyle,
inner: ?ViewStyle,
} {
let outer: ?ViewStyle = null;
let inner: ?ViewStyle = null;
let outer: ?MutableViewStyle = null;
let inner: ?MutableViewStyle = null;

if (props != null) {
// $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
outer = {};
// $FlowFixMe[incompatible-exact] Will contain a subset of keys from `props`.
inner = {};

for (const prop of Object.keys(props)) {
Expand Down Expand Up @@ -53,13 +53,11 @@ export default function splitLayoutProps(props: ?ViewStyle): {
case 'rowGap':
case 'columnGap':
case 'gap':
// $FlowFixMe[cannot-write]
// $FlowFixMe[incompatible-use]
// $FlowFixMe[prop-missing]
outer[prop] = props[prop];
break;
default:
// $FlowFixMe[cannot-write]
// $FlowFixMe[incompatible-use]
// $FlowFixMe[prop-missing]
inner[prop] = props[prop];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ type Registry<
Record<string, ReadonlyArray<UnsafeEventObject>>,
>,
> = {
[K in keyof TEventToArgsMap]: Set<Registration<TEventToArgsMap[K]>>,
-readonly [K in keyof TEventToArgsMap]?: Set<
Registration<TEventToArgsMap[K]>,
>,
};

/**
Expand Down Expand Up @@ -147,7 +149,6 @@ export default class EventEmitter<
// $FlowFixMe[incompatible-type]
this.#registry = Object.create(null);
} else {
// $FlowFixMe[cannot-write]
delete this.#registry[eventType];
}
}
Expand Down Expand Up @@ -177,7 +178,6 @@ function allocate<
registry[eventType];
if (registrations == null) {
registrations = new Set();
// $FlowFixMe[cannot-write]
registry[eventType] = registrations;
}
return registrations;
Expand Down
Loading