-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
props are loading bad values from local storage
error loading from local storage:
[TypeError: undefined is not an object (evaluating 'a.fields.Amount')]
not sure why calling SpentThisWeek(props.logs) would trigger local storage
calling TotalBudget(props.cats) also triggers local storage
hard passing a logs array of objects to SpentThisWeek([{...}, {...}, {...}] works fine
so there's something wrong with the state of props here
cannot seem to console logging during the state where that happens though.
logs are always array of objects as expected
export default function Menu(props:any) {
let limit = .75
if(props.cats && props.cats.length > 1 && props.logs && props.logs.length > 1) {
console.log("props.logs in Menu: ", props.logs) // seems fine
console.log("props.cats in Menu: ", props.cats) // also logs as expected
limit = TotalBudget(props.cats) // <--------- this is where the error begins!
console.log("totalBudget: ", limit)
}
...
}
Metadata
Metadata
Assignees
Labels
No labels