When uploading a photo, although they were uploaded successfully - it would loop infinitely. Investigation showed that this was due to the change where testApi was now the result of a function call, not just a reference. This meant every render things were changing - and causing the request to send again.
Changes proposed in this pull request
Cache the testApi in the container, preventing multiple instances of it being created.
Guidance to review
Attempt to upload a picture, check the network tab, and ensure only one request is sent.
Context
When uploading a photo, although they were uploaded successfully - it would loop infinitely. Investigation showed that this was due to the change where
testApi
was now the result of a function call, not just a reference. This meant every render things were changing - and causing the request to send again.Changes proposed in this pull request
testApi
in the container, preventing multiple instances of it being created.Guidance to review
Link to Jira task
https://bluesquirrel.atlassian.net/browse/LDAT-146