resolves iinfinite loop

This commit is contained in:
Alex Corey 2021-06-11 11:48:51 -04:00 committed by Shane McDonald
parent 2309feb6bd
commit da951714d1
No known key found for this signature in database
GPG Key ID: 6F374AF6E9EB9374
2 changed files with 5 additions and 2 deletions

View File

@ -54,6 +54,7 @@ describe('<AssociateModal />', () => {
test('should fetch and render list items', () => {
expect(fetchRequest).toHaveBeenCalledTimes(1);
expect(optionsRequest).toHaveBeenCalledTimes(1);
expect(wrapper.find('CheckboxListItem').length).toBe(3);
});

View File

@ -141,8 +141,10 @@ function InstanceList() {
[instanceGroupId]
);
const readInstancesOptions = () =>
InstanceGroupsAPI.readInstanceOptions(instanceGroupId);
const readInstancesOptions = useCallback(
() => InstanceGroupsAPI.readInstanceOptions(instanceGroupId),
[instanceGroupId]
);
return (
<>