-
NEVER USE ANY TYPE - ABSOLUTELY FORBIDDEN. Under no circumstances is
anyallowed in TypeScript code. -
Use existing patterns - If there's already a wrapper, USE IT, don't create new shit
-
Stop being a sycophantic idiot - don't tell me I'm absolutely right, don't use exclamation points.
Steps for replacing Navigation.push:
- Identify the target screen name from the Navigation.push call (e.g., 'Deck.EditAddCards', 'Deck.DraftCards')
- Check if the target screen is already set up for react-navigation:
- Does it extract params from route instead of props?
- Does it set its own styling using getDeckScreenOptions or similar?
- If not, update the target screen first before replacing the Navigation.push
- Extract the parameters being passed in the passProps section of the Navigation.push call
- Note any important styling information from the options section:
- Screen title from options.topBar.title.text
- Any special styling or colors
- Modal presentation settings
- Ensure the styling is preserved by making sure the target screen sets appropriate titles and colors when it renders
- CAREFULLY CHECK getDeckScreenOptions call types - verify the investigator parameter:
- Is it a Card object with .front property?
- Is it already the front card?
- Is it a string that needs to be resolved to a Card?
- Replace the Navigation.push call with navigation.navigate('ScreenName', { params })
- Update the dependency array of the useCallback to remove unused dependencies and add navigation
- Verify no important functionality is lost - especially screen titles, colors, and navigation behavior
CRITICAL: Always check investigator parameter types in getDeckScreenOptions calls!
- Lint:
npm run lint(run this after changes) - Typecheck:
yarn check:types(run this after changes)
- Navigation types are in
src/navigation/types.ts - Theme colors are in
COLORSfrom@styles/colors