Skip to content

Commit

Permalink
fix: check if kez exists rather than undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Jun 4, 2024
1 parent ebc8243 commit 4e1cb68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/withOnyx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ export default function <TComponentProps, TOnyxProps>(
this.tempState[statePropertyName] = val;

// If some key does not have a value yet, do not update the state yet
const tempStateIsMissingKey = requiredKeysForInit.some((key) => this.tempState?.[key as keyof TOnyxProps] === undefined);
const tempStateIsMissingKey = requiredKeysForInit.some((key) => !(key in (this.tempState ?? {})));

if (tempStateIsMissingKey) {
return;
}
Expand Down

0 comments on commit 4e1cb68

Please sign in to comment.