Skip to content

Commit

Permalink
use initialValue when cached value is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Feb 28, 2024
1 parent 1e7844c commit e571da3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/withOnyx.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function (mapOnyxToState, shouldDelayUpdates = false) {
(resultObj, mapping, propertyName) => {
const key = Str.result(mapping.key, props);
let value = Onyx.tryGetCachedValue(key, mapping);
if (!value && mapping.initialValue) {
if (value === undefined) {
value = mapping.initialValue;
}

Expand Down

0 comments on commit e571da3

Please sign in to comment.