Skip to content

Commit

Permalink
PLT-4386 review change
Browse files Browse the repository at this point in the history
  • Loading branch information
amnambiar committed Jul 25, 2023
1 parent 93fcbbd commit a88f43f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions react-web/src/components/DAPPScript/DAPPScript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ import { Input } from "compositions/Form/components/Input";
import "./DAPPScript.scss";
import { useFormContext } from "react-hook-form";
import { fieldArrayName } from "pages/auditing/reportUpload/ReportUpload";
import { useEffect, useState } from "react";

const DAPPScript = ({ remove, value, index }: any) => {
const { register, watch } = useFormContext();
const allScripts = watch(fieldArrayName);
const [length, setLength] = useState(1);

useEffect(() => {
allScripts && setLength(allScripts.length);
}, [allScripts]);
const length = !allScripts ? 1 : allScripts.length;

return (
<div
Expand Down

0 comments on commit a88f43f

Please sign in to comment.