mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #4365 from Infisical/ENG-3491
Add memo to availableConnections to fix infinite re-render issue
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useMemo } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { SingleValue } from "react-select";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
@@ -128,10 +128,10 @@ export const ExternalCaModal = ({ popUp, handlePopUpToggle }: Props) => {
|
||||
enabled: caType === CaType.ACME
|
||||
});
|
||||
|
||||
const availableConnections: TAvailableAppConnection[] = [
|
||||
...(availableRoute53Connections || []),
|
||||
...(availableCloudflareConnections || [])
|
||||
];
|
||||
const availableConnections: TAvailableAppConnection[] = useMemo(
|
||||
() => [...(availableRoute53Connections || []), ...(availableCloudflareConnections || [])],
|
||||
[availableRoute53Connections, availableCloudflareConnections]
|
||||
);
|
||||
|
||||
const isPending = isRoute53Pending || isCloudflarePending;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user