mirror of
https://github.com/react/react-native.git
synced 2026-09-28 05:13:06 +08:00
Pre-suppress errors for improved typing of Array.{includes,indexOf,lastIndexOf} in xplat
Summary: In Flow 0.284, we will have a stricter version of `Array<T>.includes`. Instead of accepting `mixed`, we will only accept `T` to help catch logical errors. We did the same for `Array.indexOf` and `Array.lastIndexOf` as well. This diff pre-suppresses newly discovered errors in part of the codebase. Changelog: [Internal] Reviewed By: marcoww6 Differential Revision: D82784398 fbshipit-source-id: 6cb11809844f964e0604d33b9f7a3989074cd1cc
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0e77015a85
commit
7ba64ca0f1
@@ -147,6 +147,8 @@ const builtinTypeResolvers: {
|
||||
const propName =
|
||||
propNode.type === 'Identifier' ? propNode.name : propNode.value;
|
||||
|
||||
/* $FlowFixMe[incompatible-type] Error exposed after improved typing
|
||||
* of Array.{includes,indexOf,lastIndexOf} */
|
||||
return !stringLiteralElements.includes(propName);
|
||||
}),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user