mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add missing strictMode prop to FlatList TypeScript types (#57674)
Summary: FlatList's `strictMode` prop is implemented in the component and declared in the Flow types (OptionalFlatListProps in FlatList.js), but missing from the shipped TypeScript definitions. TS users can't set it on <FlatList> without augmenting the module themselves. This adds `strictMode?: boolean` to the TypeScript FlatListProps, matching the Flow declaration. Types-only, no runtime change. ## Changelog: [GENERAL] [ADDED] - Add missing strictMode prop to FlatList TypeScript types Pull Request resolved: https://github.com/react/react-native/pull/57674 Test Plan: Types-only change: - Before, `<FlatList ... strictMode />` errored `(Property 'strictMode' does not exist);` - After, it type-checks. Matches the Flow prop and the runtime use in `render(): const renderer = strictMode ? this._memoizedRenderer : this._renderer;` Reviewed By: cortinico Differential Revision: D113631325 Pulled By: Abbondanzo fbshipit-source-id: 84866649daec3385b564e4c13f139aea0a787b37
This commit is contained in:
1 parent
6d0612c27c
commit
3e2403327c
1 file changed
+5
@@ -161,6 +161,11 @@ export interface FlatListProps<ItemT> extends VirtualizedListProps<ItemT> {
|
||||
* @platform android
|
||||
*/
|
||||
fadingEdgeLength?: number | {start: number; end: number} | undefined;
|
||||
|
||||
/**
|
||||
* Enable an optimization to memoize the item renderer to prevent unnecessary rerenders.
|
||||
*/
|
||||
strictMode?: boolean | undefined;
|
||||
}
|
||||
|
||||
export abstract class FlatListComponent<
|
||||
|
||||
Reference in new issue
Block a user