Remove $FlowExpectedError[sketchy-null-bool] (resolveIntersection.js)

Summary:
Replace the two nullable boolean checks `!prop.optional` and `!prop.readonly` with `prop.optional !== true` and `prop.readonly !== true`, and remove their `$FlowExpectedError[sketchy-null-bool]` suppressions.

Both flags are `?boolean`. `!x` is true for `undefined`, `null` and `false`, and false only for `true`; `x !== true` gives the same result for every one of those values, so the required and mutable key sets are unchanged.

Changelog: [Internal]

Differential Revision: D128806000

Pull Request resolved: https://github.com/react/react-native/pull/59764
This commit is contained in:
JC Perez Chavez authored and GitHub committed 2026-11-04 14:34:07 +00:00
1 parent 45152f1f85
commit 04c6ea43ad
1 file changed
+2 -4
@@ -84,13 +84,11 @@ export function resolveIntersection(
continue;
}
// $FlowExpectedError[sketchy-null-bool] Missing prop is the same as false
if (!prop.optional) {
if (prop.optional !== true) {
requiredKeys.add(key);
}
// $FlowExpectedError[sketchy-null-bool] Missing prop is the same as false
if (!prop.readonly) {
if (prop.readonly !== true) {
mutableKeys.add(key);
}