Draft
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-undefinedorgIdto components requiringstring. After thecurrentOrgIdnull guard, the spread should usecurrentOrgId.AuthProvider double-load on startup
onAuthReady={() => setIsReady(true)}was an inline function inLayout, creating a new reference on every render.AuthProvider'suseEffect([onAuthReady])re-ran on every render, callingtokenManager.load()(SecureStore I/O) twice. Fixed withuseCallback.Login
doPromptstale closure re-runsdoPromptwas defined withoutuseCallbackbut listed in auseEffectdep array, causing the effect to re-fire on every render. ConvertedisPromptingstate →isPromptingRefand wrappeddoPromptinuseCallback([promptAsync]).Ambiguous navigation path
events/index.tsxnavigated 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].tsxparamCard?.id ?? `crd_${paramCard.id}`dereferencesparamCardunconditionally in the fallback. IfparamCardisundefined(e.g. deep link withoutcardparam), this throws. Fixed to fall back to the route's[id]param:paramCard?.id ?? _routeId.Type safety for
useLocalSearchParamsuseLocalSearchParams()calls inrename.tsx,team.tsx, andinvitation/[id].tsxper codebase convention, preventingstring | string[]misuse.Checklist
💡 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.