Skip to content

fix(ui): resolve TypeScript errors in CachedImage.tsx (closes #1199) - #1204

Open
rupesh-kumar-sah wants to merge 1 commit into
rinafcode:mainfrom
rupesh-kumar-sah:fix/issue-1199-cached-image-types
Open

rupesh-kumar-sah wants to merge 1 commit into
rinafcode:mainfrom
rupesh-kumar-sah:fix/issue-1199-cached-image-types

Conversation

@rupesh-kumar-sah

Copy link
Copy Markdown

Summary

Resolves #1199.

Addresses all TypeScript compilation errors reported by tsc --noEmit in src/components/ui/CachedImage.tsx:

  • Replaced undefined: undefined typing on aspectRatioStyle and detectedDimensions with proper React state types (DimensionValue) so TypeScript avoids dead-code narrowing to never while preserving runtime falsiness.
  • Updated ExpoImage loading callback from deprecated onLoadingComplete to onLoad.
  • Removed duplicate and unused appLogger import from src/utils/logger.

Verification

  • npx tsc --noEmit reports zero errors for src/components/ui/CachedImage.tsx.
  • npx eslint src/components/ui/CachedImage.tsx passes with zero errors and zero warnings.
  • Pre-commit prettier and eslint checks verified.

…de#1199)

- Annotate aspectRatioStyle and detectedDimensions with DimensionValue to fix type narrowing
- Use onLoad prop on ExpoImage instead of deprecated onLoadingComplete
- Remove duplicate unused appLogger import
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.

Fix TypeScript errors in src/components/ui/CachedImage.tsx (type-check cleanup, part of #1074)

1 participant