@codyswann/lisa 2.111.0 → 2.112.0

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.
Files changed (155) hide show
  1. package/package.json +1 -1
  2. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  3. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  4. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  5. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  6. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  7. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  8. package/plugins/lisa-expo/.mcp.json +3 -3
  9. package/plugins/lisa-expo/THIRD-PARTY-NOTICES.md +57 -0
  10. package/plugins/lisa-expo/skills/add-app-clip/SKILL.md +280 -0
  11. package/plugins/lisa-expo/skills/add-app-clip/agents/openai.yaml +4 -0
  12. package/plugins/lisa-expo/skills/add-app-clip/references/native-module.md +96 -0
  13. package/plugins/lisa-expo/skills/building-native-ui/SKILL.md +321 -0
  14. package/plugins/lisa-expo/skills/building-native-ui/agents/openai.yaml +4 -0
  15. package/plugins/lisa-expo/skills/building-native-ui/references/animations.md +220 -0
  16. package/plugins/lisa-expo/skills/building-native-ui/references/controls.md +272 -0
  17. package/plugins/lisa-expo/skills/building-native-ui/references/form-sheet.md +253 -0
  18. package/plugins/lisa-expo/skills/building-native-ui/references/gradients.md +106 -0
  19. package/plugins/lisa-expo/skills/building-native-ui/references/icons.md +213 -0
  20. package/plugins/lisa-expo/skills/building-native-ui/references/media.md +198 -0
  21. package/plugins/lisa-expo/skills/building-native-ui/references/route-structure.md +229 -0
  22. package/plugins/lisa-expo/skills/building-native-ui/references/search.md +248 -0
  23. package/plugins/lisa-expo/skills/building-native-ui/references/storage.md +121 -0
  24. package/plugins/lisa-expo/skills/building-native-ui/references/tabs.md +433 -0
  25. package/plugins/lisa-expo/skills/building-native-ui/references/toolbar-and-headers.md +284 -0
  26. package/plugins/lisa-expo/skills/building-native-ui/references/visual-effects.md +197 -0
  27. package/plugins/lisa-expo/skills/building-native-ui/references/webgpu-three.md +605 -0
  28. package/plugins/lisa-expo/skills/building-native-ui/references/zoom-transitions.md +158 -0
  29. package/plugins/lisa-expo/skills/eas-update-insights/SKILL.md +228 -0
  30. package/plugins/lisa-expo/skills/eas-update-insights/agents/openai.yaml +4 -0
  31. package/plugins/lisa-expo/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
  32. package/plugins/lisa-expo/skills/eas-update-insights/references/update-insights-schema.md +69 -0
  33. package/plugins/lisa-expo/skills/expo-api-routes/SKILL.md +369 -0
  34. package/plugins/lisa-expo/skills/expo-api-routes/agents/openai.yaml +4 -0
  35. package/plugins/lisa-expo/skills/expo-brownfield/SKILL.md +54 -0
  36. package/plugins/lisa-expo/skills/expo-brownfield/agents/openai.yaml +4 -0
  37. package/plugins/lisa-expo/skills/expo-brownfield/references/brownfield-integrated.md +526 -0
  38. package/plugins/lisa-expo/skills/expo-brownfield/references/brownfield-isolated.md +402 -0
  39. package/plugins/lisa-expo/skills/expo-brownfield/references/comparison.md +63 -0
  40. package/plugins/lisa-expo/skills/expo-brownfield/references/troubleshooting.md +88 -0
  41. package/plugins/lisa-expo/skills/expo-cicd-workflows/SKILL.md +92 -0
  42. package/plugins/lisa-expo/skills/expo-cicd-workflows/agents/openai.yaml +4 -0
  43. package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/fetch.js +113 -0
  44. package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/package.json +11 -0
  45. package/plugins/lisa-expo/skills/expo-cicd-workflows/scripts/validate.js +85 -0
  46. package/plugins/lisa-expo/skills/expo-deployment/SKILL.md +190 -0
  47. package/plugins/lisa-expo/skills/expo-deployment/agents/openai.yaml +4 -0
  48. package/plugins/lisa-expo/skills/expo-deployment/references/app-store-metadata.md +479 -0
  49. package/plugins/lisa-expo/skills/expo-deployment/references/ios-app-store.md +355 -0
  50. package/plugins/lisa-expo/skills/expo-deployment/references/play-store.md +246 -0
  51. package/plugins/lisa-expo/skills/expo-deployment/references/testflight.md +58 -0
  52. package/plugins/lisa-expo/skills/expo-deployment/references/workflows.md +200 -0
  53. package/plugins/lisa-expo/skills/expo-dev-client/SKILL.md +164 -0
  54. package/plugins/lisa-expo/skills/expo-dev-client/agents/openai.yaml +4 -0
  55. package/plugins/lisa-expo/skills/expo-module/SKILL.md +141 -0
  56. package/plugins/lisa-expo/skills/expo-module/agents/openai.yaml +4 -0
  57. package/plugins/lisa-expo/skills/expo-module/references/config-plugin.md +90 -0
  58. package/plugins/lisa-expo/skills/expo-module/references/create-expo-module.md +206 -0
  59. package/plugins/lisa-expo/skills/expo-module/references/lifecycle.md +127 -0
  60. package/plugins/lisa-expo/skills/expo-module/references/module-config.md +48 -0
  61. package/plugins/lisa-expo/skills/expo-module/references/native-module.md +286 -0
  62. package/plugins/lisa-expo/skills/expo-module/references/native-view.md +171 -0
  63. package/plugins/lisa-expo/skills/expo-tailwind-setup/SKILL.md +480 -0
  64. package/plugins/lisa-expo/skills/expo-tailwind-setup/agents/openai.yaml +4 -0
  65. package/plugins/lisa-expo/skills/expo-ui-jetpack-compose/SKILL.md +40 -0
  66. package/plugins/lisa-expo/skills/expo-ui-jetpack-compose/agents/openai.yaml +4 -0
  67. package/plugins/lisa-expo/skills/expo-ui-swift-ui/SKILL.md +39 -0
  68. package/plugins/lisa-expo/skills/expo-ui-swift-ui/agents/openai.yaml +4 -0
  69. package/plugins/lisa-expo/skills/native-data-fetching/SKILL.md +507 -0
  70. package/plugins/lisa-expo/skills/native-data-fetching/agents/openai.yaml +4 -0
  71. package/plugins/lisa-expo/skills/native-data-fetching/references/expo-router-loaders.md +344 -0
  72. package/plugins/lisa-expo/skills/upgrading-expo/SKILL.md +134 -0
  73. package/plugins/lisa-expo/skills/upgrading-expo/agents/openai.yaml +4 -0
  74. package/plugins/lisa-expo/skills/upgrading-expo/references/expo-av-to-audio.md +132 -0
  75. package/plugins/lisa-expo/skills/upgrading-expo/references/expo-av-to-video.md +160 -0
  76. package/plugins/lisa-expo/skills/upgrading-expo/references/native-tabs.md +124 -0
  77. package/plugins/lisa-expo/skills/upgrading-expo/references/new-architecture.md +79 -0
  78. package/plugins/lisa-expo/skills/upgrading-expo/references/react-19.md +79 -0
  79. package/plugins/lisa-expo/skills/upgrading-expo/references/react-compiler.md +59 -0
  80. package/plugins/lisa-expo/skills/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
  81. package/plugins/lisa-expo/skills/use-dom/SKILL.md +417 -0
  82. package/plugins/lisa-expo/skills/use-dom/agents/openai.yaml +4 -0
  83. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  84. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  85. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  86. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  87. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  88. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  89. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  90. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  91. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  92. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  93. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  94. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  95. package/plugins/src/expo/.mcp.json +3 -3
  96. package/plugins/src/expo/THIRD-PARTY-NOTICES.md +57 -0
  97. package/plugins/src/expo/skills/add-app-clip/SKILL.md +280 -0
  98. package/plugins/src/expo/skills/add-app-clip/references/native-module.md +96 -0
  99. package/plugins/src/expo/skills/building-native-ui/SKILL.md +321 -0
  100. package/plugins/src/expo/skills/building-native-ui/references/animations.md +220 -0
  101. package/plugins/src/expo/skills/building-native-ui/references/controls.md +272 -0
  102. package/plugins/src/expo/skills/building-native-ui/references/form-sheet.md +253 -0
  103. package/plugins/src/expo/skills/building-native-ui/references/gradients.md +106 -0
  104. package/plugins/src/expo/skills/building-native-ui/references/icons.md +213 -0
  105. package/plugins/src/expo/skills/building-native-ui/references/media.md +198 -0
  106. package/plugins/src/expo/skills/building-native-ui/references/route-structure.md +229 -0
  107. package/plugins/src/expo/skills/building-native-ui/references/search.md +248 -0
  108. package/plugins/src/expo/skills/building-native-ui/references/storage.md +121 -0
  109. package/plugins/src/expo/skills/building-native-ui/references/tabs.md +433 -0
  110. package/plugins/src/expo/skills/building-native-ui/references/toolbar-and-headers.md +284 -0
  111. package/plugins/src/expo/skills/building-native-ui/references/visual-effects.md +197 -0
  112. package/plugins/src/expo/skills/building-native-ui/references/webgpu-three.md +605 -0
  113. package/plugins/src/expo/skills/building-native-ui/references/zoom-transitions.md +158 -0
  114. package/plugins/src/expo/skills/eas-update-insights/SKILL.md +228 -0
  115. package/plugins/src/expo/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
  116. package/plugins/src/expo/skills/eas-update-insights/references/update-insights-schema.md +69 -0
  117. package/plugins/src/expo/skills/expo-api-routes/SKILL.md +369 -0
  118. package/plugins/src/expo/skills/expo-brownfield/SKILL.md +54 -0
  119. package/plugins/src/expo/skills/expo-brownfield/references/brownfield-integrated.md +526 -0
  120. package/plugins/src/expo/skills/expo-brownfield/references/brownfield-isolated.md +402 -0
  121. package/plugins/src/expo/skills/expo-brownfield/references/comparison.md +63 -0
  122. package/plugins/src/expo/skills/expo-brownfield/references/troubleshooting.md +88 -0
  123. package/plugins/src/expo/skills/expo-cicd-workflows/SKILL.md +92 -0
  124. package/plugins/src/expo/skills/expo-cicd-workflows/scripts/fetch.js +113 -0
  125. package/plugins/src/expo/skills/expo-cicd-workflows/scripts/package.json +11 -0
  126. package/plugins/src/expo/skills/expo-cicd-workflows/scripts/validate.js +85 -0
  127. package/plugins/src/expo/skills/expo-deployment/SKILL.md +190 -0
  128. package/plugins/src/expo/skills/expo-deployment/references/app-store-metadata.md +479 -0
  129. package/plugins/src/expo/skills/expo-deployment/references/ios-app-store.md +355 -0
  130. package/plugins/src/expo/skills/expo-deployment/references/play-store.md +246 -0
  131. package/plugins/src/expo/skills/expo-deployment/references/testflight.md +58 -0
  132. package/plugins/src/expo/skills/expo-deployment/references/workflows.md +200 -0
  133. package/plugins/src/expo/skills/expo-dev-client/SKILL.md +164 -0
  134. package/plugins/src/expo/skills/expo-module/SKILL.md +141 -0
  135. package/plugins/src/expo/skills/expo-module/references/config-plugin.md +90 -0
  136. package/plugins/src/expo/skills/expo-module/references/create-expo-module.md +206 -0
  137. package/plugins/src/expo/skills/expo-module/references/lifecycle.md +127 -0
  138. package/plugins/src/expo/skills/expo-module/references/module-config.md +48 -0
  139. package/plugins/src/expo/skills/expo-module/references/native-module.md +286 -0
  140. package/plugins/src/expo/skills/expo-module/references/native-view.md +171 -0
  141. package/plugins/src/expo/skills/expo-tailwind-setup/SKILL.md +480 -0
  142. package/plugins/src/expo/skills/expo-ui-jetpack-compose/SKILL.md +40 -0
  143. package/plugins/src/expo/skills/expo-ui-swift-ui/SKILL.md +39 -0
  144. package/plugins/src/expo/skills/native-data-fetching/SKILL.md +507 -0
  145. package/plugins/src/expo/skills/native-data-fetching/references/expo-router-loaders.md +344 -0
  146. package/plugins/src/expo/skills/upgrading-expo/SKILL.md +134 -0
  147. package/plugins/src/expo/skills/upgrading-expo/references/expo-av-to-audio.md +132 -0
  148. package/plugins/src/expo/skills/upgrading-expo/references/expo-av-to-video.md +160 -0
  149. package/plugins/src/expo/skills/upgrading-expo/references/native-tabs.md +124 -0
  150. package/plugins/src/expo/skills/upgrading-expo/references/new-architecture.md +79 -0
  151. package/plugins/src/expo/skills/upgrading-expo/references/react-19.md +79 -0
  152. package/plugins/src/expo/skills/upgrading-expo/references/react-compiler.md +59 -0
  153. package/plugins/src/expo/skills/upgrading-expo/references/react-navigation-to-expo-router.md +61 -0
  154. package/plugins/src/expo/skills/use-dom/SKILL.md +417 -0
  155. package/scripts/generate-codex-plugin-artifacts.mjs +7 -2
@@ -0,0 +1,248 @@
1
+ # Search
2
+
3
+ ## Header Search Bar
4
+
5
+ Add a search bar to the stack header with `headerSearchBarOptions`:
6
+
7
+ ```tsx
8
+ <Stack.Screen
9
+ name="index"
10
+ options={{
11
+ headerSearchBarOptions: {
12
+ placeholder: "Search",
13
+ onChangeText: (event) => console.log(event.nativeEvent.text),
14
+ },
15
+ }}
16
+ />
17
+ ```
18
+
19
+ ### Options
20
+
21
+ ```tsx
22
+ headerSearchBarOptions: {
23
+ // Placeholder text
24
+ placeholder: "Search items...",
25
+
26
+ // Auto-capitalize behavior
27
+ autoCapitalize: "none",
28
+
29
+ // Input type
30
+ inputType: "text", // "text" | "phone" | "number" | "email"
31
+
32
+ // Cancel button text (iOS)
33
+ cancelButtonText: "Cancel",
34
+
35
+ // Hide when scrolling (iOS)
36
+ hideWhenScrolling: true,
37
+
38
+ // Hide navigation bar during search (iOS)
39
+ hideNavigationBar: true,
40
+
41
+ // Obscure background during search (iOS)
42
+ obscureBackground: true,
43
+
44
+ // Placement
45
+ placement: "automatic", // "automatic" | "inline" | "stacked"
46
+
47
+ // Callbacks
48
+ onChangeText: (event) => {},
49
+ onSearchButtonPress: (event) => {},
50
+ onCancelButtonPress: (event) => {},
51
+ onFocus: () => {},
52
+ onBlur: () => {},
53
+ }
54
+ ```
55
+
56
+ ## useSearch Hook
57
+
58
+ Reusable hook for search state management:
59
+
60
+ ```tsx
61
+ import { useEffect, useState } from "react";
62
+ import { useNavigation } from "expo-router";
63
+
64
+ export function useSearch(options: any = {}) {
65
+ const [search, setSearch] = useState("");
66
+ const navigation = useNavigation();
67
+
68
+ useEffect(() => {
69
+ navigation.setOptions({
70
+ headerShown: true,
71
+ headerSearchBarOptions: {
72
+ ...options,
73
+ onChangeText(e: any) {
74
+ setSearch(e.nativeEvent.text);
75
+ options.onChangeText?.(e);
76
+ },
77
+ onSearchButtonPress(e: any) {
78
+ setSearch(e.nativeEvent.text);
79
+ options.onSearchButtonPress?.(e);
80
+ },
81
+ onCancelButtonPress(e: any) {
82
+ setSearch("");
83
+ options.onCancelButtonPress?.(e);
84
+ },
85
+ },
86
+ });
87
+ }, [options, navigation]);
88
+
89
+ return search;
90
+ }
91
+ ```
92
+
93
+ ### Usage
94
+
95
+ ```tsx
96
+ function SearchScreen() {
97
+ const search = useSearch({ placeholder: "Search items..." });
98
+
99
+ const filteredItems = items.filter(item =>
100
+ item.name.toLowerCase().includes(search.toLowerCase())
101
+ );
102
+
103
+ return (
104
+ <FlatList
105
+ data={filteredItems}
106
+ renderItem={({ item }) => <ItemRow item={item} />}
107
+ />
108
+ );
109
+ }
110
+ ```
111
+
112
+ ## Filtering Patterns
113
+
114
+ ### Simple Text Filter
115
+
116
+ ```tsx
117
+ const filtered = items.filter(item =>
118
+ item.name.toLowerCase().includes(search.toLowerCase())
119
+ );
120
+ ```
121
+
122
+ ### Multiple Fields
123
+
124
+ ```tsx
125
+ const filtered = items.filter(item => {
126
+ const query = search.toLowerCase();
127
+ return (
128
+ item.name.toLowerCase().includes(query) ||
129
+ item.description.toLowerCase().includes(query) ||
130
+ item.tags.some(tag => tag.toLowerCase().includes(query))
131
+ );
132
+ });
133
+ ```
134
+
135
+ ### Debounced Search
136
+
137
+ For expensive filtering or API calls:
138
+
139
+ ```tsx
140
+ import { useState, useEffect, useMemo } from "react";
141
+
142
+ function useDebounce<T>(value: T, delay: number): T {
143
+ const [debounced, setDebounced] = useState(value);
144
+
145
+ useEffect(() => {
146
+ const timer = setTimeout(() => setDebounced(value), delay);
147
+ return () => clearTimeout(timer);
148
+ }, [value, delay]);
149
+
150
+ return debounced;
151
+ }
152
+
153
+ function SearchScreen() {
154
+ const search = useSearch();
155
+ const debouncedSearch = useDebounce(search, 300);
156
+
157
+ const filteredItems = useMemo(() =>
158
+ items.filter(item =>
159
+ item.name.toLowerCase().includes(debouncedSearch.toLowerCase())
160
+ ),
161
+ [debouncedSearch]
162
+ );
163
+
164
+ return <FlatList data={filteredItems} />;
165
+ }
166
+ ```
167
+
168
+ ## Search with Native Tabs
169
+
170
+ When using NativeTabs with a search role, the search bar integrates with the tab bar:
171
+
172
+ ```tsx
173
+ // app/_layout.tsx
174
+ <NativeTabs>
175
+ <NativeTabs.Trigger name="(home)">
176
+ <Label>Home</Label>
177
+ <Icon sf="house.fill" />
178
+ </NativeTabs.Trigger>
179
+ <NativeTabs.Trigger name="(search)" role="search">
180
+ <Label>Search</Label>
181
+ </NativeTabs.Trigger>
182
+ </NativeTabs>
183
+ ```
184
+
185
+ ```tsx
186
+ // app/(search)/_layout.tsx
187
+ <Stack>
188
+ <Stack.Screen
189
+ name="index"
190
+ options={{
191
+ headerSearchBarOptions: {
192
+ placeholder: "Search...",
193
+ onChangeText: (e) => setSearch(e.nativeEvent.text),
194
+ },
195
+ }}
196
+ />
197
+ </Stack>
198
+ ```
199
+
200
+ ## Empty States
201
+
202
+ Show appropriate UI when search returns no results:
203
+
204
+ ```tsx
205
+ function SearchResults({ search, items }) {
206
+ const filtered = items.filter(/* ... */);
207
+
208
+ if (search && filtered.length === 0) {
209
+ return (
210
+ <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
211
+ <Text style={{ color: PlatformColor("secondaryLabel") }}>
212
+ No results for "{search}"
213
+ </Text>
214
+ </View>
215
+ );
216
+ }
217
+
218
+ return <FlatList data={filtered} />;
219
+ }
220
+ ```
221
+
222
+ ## Search Suggestions
223
+
224
+ Show recent searches or suggestions:
225
+
226
+ ```tsx
227
+ function SearchScreen() {
228
+ const search = useSearch();
229
+ const [recentSearches, setRecentSearches] = useState<string[]>([]);
230
+
231
+ if (!search && recentSearches.length > 0) {
232
+ return (
233
+ <View>
234
+ <Text style={{ color: PlatformColor("secondaryLabel") }}>
235
+ Recent Searches
236
+ </Text>
237
+ {recentSearches.map((term) => (
238
+ <Pressable key={term} onPress={() => /* apply search */}>
239
+ <Text>{term}</Text>
240
+ </Pressable>
241
+ ))}
242
+ </View>
243
+ );
244
+ }
245
+
246
+ return <SearchResults search={search} />;
247
+ }
248
+ ```
@@ -0,0 +1,121 @@
1
+ # Storage
2
+
3
+ ## Key-Value Storage
4
+
5
+ Use the localStorage polyfill for key-value storage. **Never use AsyncStorage**
6
+
7
+ ```tsx
8
+ import "expo-sqlite/localStorage/install";
9
+
10
+ // Simple get/set
11
+ localStorage.setItem("key", "value");
12
+ localStorage.getItem("key");
13
+
14
+ // Store objects as JSON
15
+ localStorage.setItem("user", JSON.stringify({ name: "John", id: 1 }));
16
+ const user = JSON.parse(localStorage.getItem("user") ?? "{}");
17
+ ```
18
+
19
+ ## When to Use What
20
+
21
+ | Use Case | Solution |
22
+ | ---------------------------------------------------- | ----------------------- |
23
+ | Simple key-value (settings, preferences, small data) | `localStorage` polyfill |
24
+ | Large datasets, complex queries, relational data | Full `expo-sqlite` |
25
+ | Sensitive data (tokens, passwords) | `expo-secure-store` |
26
+
27
+ ## Storage with React State
28
+
29
+ Create a storage utility with subscriptions for reactive updates:
30
+
31
+ ```tsx
32
+ // utils/storage.ts
33
+ import "expo-sqlite/localStorage/install";
34
+
35
+ type Listener = () => void;
36
+ const listeners = new Map<string, Set<Listener>>();
37
+
38
+ export const storage = {
39
+ get<T>(key: string, defaultValue: T): T {
40
+ const value = localStorage.getItem(key);
41
+ return value ? JSON.parse(value) : defaultValue;
42
+ },
43
+
44
+ set<T>(key: string, value: T): void {
45
+ localStorage.setItem(key, JSON.stringify(value));
46
+ listeners.get(key)?.forEach((fn) => fn());
47
+ },
48
+
49
+ subscribe(key: string, listener: Listener): () => void {
50
+ if (!listeners.has(key)) listeners.set(key, new Set());
51
+ listeners.get(key)!.add(listener);
52
+ return () => listeners.get(key)?.delete(listener);
53
+ },
54
+ };
55
+ ```
56
+
57
+ ## React Hook for Storage
58
+
59
+ ```tsx
60
+ // hooks/use-storage.ts
61
+ import { useSyncExternalStore } from "react";
62
+ import { storage } from "@/utils/storage";
63
+
64
+ export function useStorage<T>(
65
+ key: string,
66
+ defaultValue: T
67
+ ): [T, (value: T) => void] {
68
+ const value = useSyncExternalStore(
69
+ (cb) => storage.subscribe(key, cb),
70
+ () => storage.get(key, defaultValue)
71
+ );
72
+
73
+ return [value, (newValue: T) => storage.set(key, newValue)];
74
+ }
75
+ ```
76
+
77
+ Usage:
78
+
79
+ ```tsx
80
+ function Settings() {
81
+ const [theme, setTheme] = useStorage("theme", "light");
82
+
83
+ return (
84
+ <Switch
85
+ value={theme === "dark"}
86
+ onValueChange={(dark) => setTheme(dark ? "dark" : "light")}
87
+ />
88
+ );
89
+ }
90
+ ```
91
+
92
+ ## Full SQLite for Complex Data
93
+
94
+ For larger datasets or complex queries, use expo-sqlite directly:
95
+
96
+ ```tsx
97
+ import * as SQLite from "expo-sqlite";
98
+
99
+ const db = await SQLite.openDatabaseAsync("app.db");
100
+
101
+ // Create table
102
+ await db.execAsync(`
103
+ CREATE TABLE IF NOT EXISTS events (
104
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
105
+ title TEXT NOT NULL,
106
+ date TEXT NOT NULL,
107
+ location TEXT
108
+ )
109
+ `);
110
+
111
+ // Insert
112
+ await db.runAsync("INSERT INTO events (title, date) VALUES (?, ?)", [
113
+ "Meeting",
114
+ "2024-01-15",
115
+ ]);
116
+
117
+ // Query
118
+ const events = await db.getAllAsync("SELECT * FROM events WHERE date > ?", [
119
+ "2024-01-01",
120
+ ]);
121
+ ```