Skip to content

Commit

Permalink
chore: fix type error in ObservationsList component (#280)
Browse files Browse the repository at this point in the history
This is a types-only change and should have no impact on functionality.

TypeScript complained about the type we used for `<FlatList>`'s
`getItemLayout` prop. Specifically, it complained that the first
argument was invalid.

We don't even use the first argument, so we can just use the `unknown`
type to sidestep this issue.
  • Loading branch information
EvanHahn authored Apr 25, 2024
1 parent 1b8701a commit 85cecfa
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/frontend/screens/ObservationsList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ const m = defineMessages({

const OBSERVATION_CELL_HEIGHT = 80;

const getItemLayout = (
data: Observation[] | null | undefined,
index: number,
) => ({
const getItemLayout = (_data: unknown, index: number) => ({
length: OBSERVATION_CELL_HEIGHT,
offset: OBSERVATION_CELL_HEIGHT * index,
index,
Expand Down

0 comments on commit 85cecfa

Please sign in to comment.