@umituz/react-native-settings 4.1.5 → 4.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-settings",
3
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "description": "Settings management for React Native apps - user preferences, theme, language, notifications",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -90,4 +90,4 @@
90
90
  "README.md",
91
91
  "LICENSE"
92
92
  ]
93
- }
93
+ }
@@ -58,17 +58,23 @@ export const SettingsStackNavigator: React.FC<SettingsStackNavigatorProps> = ({
58
58
  headerTintColor: tokens.colors.textPrimary,
59
59
  };
60
60
 
61
+ // Memoize SettingsScreen wrapper to prevent remounting on every render
62
+ const SettingsScreenWrapper = React.useMemo(() => {
63
+ const Wrapper = () => <SettingsScreen config={config} />;
64
+ Wrapper.displayName = "SettingsScreenWrapper";
65
+ return Wrapper;
66
+ }, [config]);
67
+
61
68
  return (
62
69
  <Stack.Navigator screenOptions={screenOptions}>
63
70
  <Stack.Screen
64
71
  name="Settings"
72
+ component={SettingsScreenWrapper}
65
73
  options={{
66
74
  headerShown: false,
67
75
  title: "Settings",
68
76
  }}
69
- >
70
- {() => <SettingsScreen config={config} />}
71
- </Stack.Screen>
77
+ />
72
78
 
73
79
  <Stack.Screen
74
80
  name="Appearance"