Fix map failing to render, dedupe expo-crypto
The home screen passed its FlatList header as `ListHeaderComponent={() =>
(...)}`. VirtualizedList renders a function-valued header prop as
`<HeaderComponent />`, so a fresh arrow function on each render is a fresh
element type: React unmounted the entire header subtree — MapView included —
and mounted a new one. Home re-renders several times on mount (useFetch
loading->data, useUserLocation pending->granted, session resolve), and
recreating the Android GoogleMap surface each time left it grey with the
Google logo and tiles that never finished loading.
Pass the header as an element instead so the type stays stable and MapView
mounts once. The same `() => (...)` pattern in ListEmptyComponent here, and in
rides.tsx and confirm-ride.tsx, cost needless remounts of list chrome and
DriverCards; fixed alongside.
Also pin expo-crypto to ~13.0.2. It was ^57.0.1 — a wrong-major native module
for SDK 51 that nothing in the app imports. npm hoisted it to the top level
and gave expo-auth-session a nested 13.0.2 to satisfy its ~13.0.0 constraint,
leaving two copies of one native module in the tree for autolinking to choose
between.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
59e336c23d
commit
4e0a7cca51
@@ -193,7 +193,15 @@ EXPO_PUBLIC_GEOAPIFY_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
- Go to the [Google Cloud Console](https://console.cloud.google.com/).
|
||||
- Create a new project (or use an existing one).
|
||||
- Navigate to the "APIs & Services" section and enable the required APIs (Places API, Directions API).
|
||||
- Navigate to the "APIs & Services" section and enable **all** of the required APIs:
|
||||
- **Maps SDK for Android** — draws the map itself. Without it Android renders an
|
||||
empty grey tile area and logcat shows an authorization failure; the app looks
|
||||
like the map "didn't load."
|
||||
- **Maps SDK for iOS** — only needed if `components/map.tsx` is switched from
|
||||
`PROVIDER_DEFAULT` (Apple Maps) to `PROVIDER_GOOGLE`.
|
||||
- **Places API (New)** — destination search in `components/google-text-input.tsx`.
|
||||
The legacy Places web service is unavailable to newer Google Cloud projects.
|
||||
- **Directions API** — route polyline and driver ETAs.
|
||||
- Go to the "Credentials" tab and click on "Create Credentials."
|
||||
- Select "API Key."
|
||||
- Copy the generated **API Key** and add it to your `.env` file:
|
||||
|
||||
Reference in New Issue
Block a user