diff --git a/airbyte-webapp/src/hooks/services/Analytics/useAnalyticsService.tsx b/airbyte-webapp/src/hooks/services/Analytics/useAnalyticsService.tsx index f6f9e03cd724..4268c96f439a 100644 --- a/airbyte-webapp/src/hooks/services/Analytics/useAnalyticsService.tsx +++ b/airbyte-webapp/src/hooks/services/Analytics/useAnalyticsService.tsx @@ -89,12 +89,13 @@ export const useAnalyticsRegisterValues = (props?: AnalyticsContext | null): voi const { addContextProps, removeContextProps } = useAnalytics(); useEffect(() => { - if (props) { - addContextProps(props); - - return () => removeContextProps(Object.keys(props)); + if (!props) { + return; } + addContextProps(props); + return () => removeContextProps(Object.keys(props)); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [props]); }; diff --git a/airbyte-webapp/src/hooks/services/Feature/FeatureService.tsx b/airbyte-webapp/src/hooks/services/Feature/FeatureService.tsx index f895f294c238..cbf53962af24 100644 --- a/airbyte-webapp/src/hooks/services/Feature/FeatureService.tsx +++ b/airbyte-webapp/src/hooks/services/Feature/FeatureService.tsx @@ -57,12 +57,14 @@ export const useFeatureRegisterValues = (props?: Feature[] | null): void => { const { registerFeature, unregisterFeature } = useFeatureService(); useDeepCompareEffect(() => { - if (props) { - registerFeature(props); - - return () => unregisterFeature(props.map((feature: Feature) => feature.id)); + if (!props) { + return; } + registerFeature(props); + + return () => unregisterFeature(props.map((feature: Feature) => feature.id)); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [props]); }; diff --git a/airbyte-webapp/src/views/Connector/ServiceForm/ServiceForm.tsx b/airbyte-webapp/src/views/Connector/ServiceForm/ServiceForm.tsx index 54096d48be5e..dbaf36e2b3c7 100644 --- a/airbyte-webapp/src/views/Connector/ServiceForm/ServiceForm.tsx +++ b/airbyte-webapp/src/views/Connector/ServiceForm/ServiceForm.tsx @@ -82,15 +82,17 @@ const SetDefaultName: React.FC = () => { const { selectedService } = useServiceForm(); useEffect(() => { - if (selectedService) { - const timeout = setTimeout(() => { - // We need to push this out one execution slot, so the form isn't still in its - // initialization status and won't react to this call but would just take the initialValues instead. - setFieldValue("name", selectedService.name); - }); - return () => clearTimeout(timeout); + if (!selectedService) { + return; } + const timeout = setTimeout(() => { + // We need to push this out one execution slot, so the form isn't still in its + // initialization status and won't react to this call but would just take the initialValues instead. + setFieldValue("name", selectedService.name); + }); + return () => clearTimeout(timeout); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedService]); @@ -156,9 +158,9 @@ const ServiceForm: React.FC = (props) => { const { formFields, initialValues } = useBuildForm(jsonSchema, formValues); const { setDocumentationUrl, setDocumentationPanelOpen } = useDocumentationPanelContext(); - useMemo(() => { + useEffect(() => { if (!selectedConnectorDefinitionSpecification) { - return undefined; + return; } const selectedServiceDefinition = availableServices.find((service) => {