4👍
✅
You’re changing isWeekend
as the component is rendered, therefore causing the component to rerender, I believe this is causing the infinite loop.
Don’t calculate isWeekend
as part of dayOfWeek
. I think the best solution would be to create another method.
EDIT: as suggested in a comment, using computed values is probably an even better solution.
Source:stackexchange.com