Fix issue with API called in infinite loop Fix useRef so that it can store data in 'forecast' and then be able to retrieve it from there