@fadyshawky/react-native-magic 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Plug and play** – create your app and start developing without hassle.
4
4
 
5
- A production-ready React Native template with TypeScript, Redux, React Navigation, and a scalable architecture (Uprise-style). Use it to bootstrap new apps with one command.
5
+ A production-ready React Native template with TypeScript, Redux Toolkit, React Navigation, and a scalable architecture (Uprise-style). Use it to bootstrap new apps with one command.
6
6
 
7
7
  ## Requirements
8
8
 
@@ -43,6 +43,7 @@ npm run ios # or an Android variant below
43
43
  2. **API** – Copy `.env.example` to `.env` and set `API_BASE_URL` (and other vars) for your backend.
44
44
  3. **Theme** – Edit `src/core/theme/colors.ts` (and `fonts.ts`, `commonSizes.ts` if needed) for your brand.
45
45
  4. **Config** – Optional: adjust `src/core/config/index.ts` for feature toggles or app-level constants.
46
+ 5. **Lists** – Use `src/common/components/FlatListWrapper.tsx` (FlashList-backed) and tune `estimatedItemSize` for heavy lists.
46
47
 
47
48
  ## Documentation
48
49
 
@@ -57,7 +58,7 @@ In your generated project you’ll have:
57
58
  ```
58
59
  src/
59
60
  ├── common/ # Shared components, localization, helpers, validations, utils
60
- ├── core/ # Store (Redux), API, theme, config
61
+ ├── core/ # Store (Redux Toolkit), API, theme, config
61
62
  ├── navigation/ # Auth stack, main stack, tabs
62
63
  ├── screens/ # Feature screens
63
64
  └── sheetManager/ # Action sheets
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fadyshawky/react-native-magic",
3
- "version": "2.2.0",
4
- "description": "Plug-and-play React Native template: TypeScript, Redux, React Navigation, scalable architecture. Init and start developing without hassle.",
3
+ "version": "2.2.1",
4
+ "description": "Plug-and-play React Native template: TypeScript, Redux Toolkit, React Navigation, scalable architecture. Init and start developing without hassle.",
5
5
  "keywords": [
6
6
  "react-native-magic",
7
7
  "react-native",
@@ -22,6 +22,7 @@
22
22
  "@react-navigation/native": "7.1.33",
23
23
  "@react-navigation/native-stack": "7.14.4",
24
24
  "@reduxjs/toolkit": "2.11.2",
25
+ "@shopify/flash-list": "^2.0.2",
25
26
  "axios": "1.13.6",
26
27
  "babel-plugin-transform-remove-console": "6.9.4",
27
28
  "dayjs": "1.11.19",
@@ -1,5 +1,5 @@
1
1
  import React, {FC, useMemo} from 'react';
2
- import {FlatList, FlatListProps} from 'react-native';
2
+ import {FlashList, FlashListProps} from '@shopify/flash-list';
3
3
  import {LoadState} from '../../../types';
4
4
  import {TryAgain} from './TryAgain';
5
5
  import {Separator} from './Separator';
@@ -9,14 +9,16 @@ import {localization} from '../localization/localization';
9
9
  import {defaultKeyIdExtractor} from '../helpers/defaultKeyIdExtractor';
10
10
  import {CommonStyles} from '../../core/theme/commonStyles';
11
11
 
12
- interface IProps extends FlatListProps<any> {
12
+ interface IProps extends FlashListProps<any> {
13
13
  loadState: LoadState;
14
14
  tryAgain?: () => void;
15
15
  error?: string | null;
16
16
  }
17
17
 
18
+ // Shared FlashList defaults. Tune estimatedItemSize per-screen for long/heavy lists.
18
19
  const FlatListWrapperProps = {
19
20
  keyExtractor: defaultKeyIdExtractor,
21
+ estimatedItemSize: 72,
20
22
  ListEmptyComponent: (
21
23
  <EmptyView
22
24
  title={localization.empty.noData}
@@ -54,13 +56,12 @@ export function FlatListWrapper({
54
56
  return <LoadingComponent />;
55
57
  } else {
56
58
  return (
57
- <FlatList
59
+ <FlashList
58
60
  contentContainerStyle={CommonStyles.listContentContainer}
59
61
  {...FlatListWrapperProps}
60
62
  {...props}
61
63
  refreshing={refreshing}
62
64
  ListEmptyComponent={ListEmptyComponent}
63
- removeClippedSubviews={true}
64
65
  />
65
66
  );
66
67
  }