Skip to content

Fix bugs in Expo Router migration#407

Draft
Copilot wants to merge 4 commits intouse-expo-routerfrom
copilot/rewrite-navigation-to-expo-router
Draft

Fix bugs in Expo Router migration#407
Copilot wants to merge 4 commits intouse-expo-routerfrom
copilot/rewrite-navigation-to-expo-router

Conversation

Copy link

Copilot AI commented Mar 5, 2026

Summary of the problem

PR #399 rewrites HCB Mobile from React Native Navigation to Expo Router. This PR reviews all 112 changed files and fixes bugs introduced by the migration.

Describe your changes

Critical type error

  • transactionViewProps = { orgId } passed potentially-undefined orgId to components requiring string. After the currentOrgId null guard, the spread should use currentOrgId.

AuthProvider double-load on startup

  • onAuthReady={() => setIsReady(true)} was an inline function in Layout, creating a new reference on every render. AuthProvider's useEffect([onAuthReady]) re-ran on every render, calling tokenManager.load() (SecureStore I/O) twice. Fixed with useCallback.

Login doPrompt stale closure re-runs

  • doPrompt was defined without useCallback but listed in a useEffect dep array, causing the effect to re-fire on every render. Converted isPrompting state → isPromptingRef and wrapped doPrompt in useCallback([promptAsync]).

Ambiguous navigation path

  • events/index.tsx navigated to events using bare "[id]" instead of "/(events)/[id]" — the only place in the codebase using a relative path for this route.

Null crash in cards/[id].tsx

  • paramCard?.id ?? `crd_${paramCard.id}` dereferences paramCard unconditionally in the fallback. If paramCard is undefined (e.g. deep link without card param), this throws. Fixed to fall back to the route's [id] param: paramCard?.id ?? _routeId.

Type safety for useLocalSearchParams

  • Added explicit type params to untyped useLocalSearchParams() calls in rename.tsx, team.tsx, and invitation/[id].tsx per codebase convention, preventing string | string[] misuse.

Checklist

  • Descriptive PR title (Does the title explain the changes in a concise manner?)
  • Tag related issues so they auto-close on merge
  • Easily digestible commits (Are the commits small and easy to understand?) video
  • CI passes (Do the GitHub checks pass?)
  • Tested by submitter before requesting review (Does it work in development iOS/android? )

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits March 5, 2026 02:27
 into copilot/rewrite-navigation-to-expo-router
Co-authored-by: manuthecoder <77016441+manuthecoder@users.noreply.github.com>
… navigation paths, type safety

Co-authored-by: manuthecoder <77016441+manuthecoder@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite hcb mobile from React Native Navigation to Expo Router Fix bugs in Expo Router migration Mar 5, 2026
@manuthecoder manuthecoder changed the base branch from main to use-expo-router March 5, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants