David Ewins
Error library

Feed shows an error state for every address: ReferenceError before initialization

React NativeConfirmed fix

TypeScript 5.9

Error
ReferenceError: Cannot access 'scoreById' before initialization

Cause

A .map() callback read a const declared a few lines further down. With an empty array the callback never runs, so tests and CI passed; with one item it threw inside the react-query queryFn and the screen showed its error state. TypeScript does not flag use-before-declaration inside a nested closure.

Fix

Move the declaration above its first use. Add a test with at least one item, not only an empty list.

More React Native errors

Search all errors