From 427c11e0c4a66fbc1aabee8735c5e7a013df6b05 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 2 Jun 2023 14:40:09 +0200 Subject: [PATCH] :ok_hand: #43 - PR feedback. --- src/containers/multiple/multiple.container.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/containers/multiple/multiple.container.tsx b/src/containers/multiple/multiple.container.tsx index 0cc96b6..35a6c9d 100644 --- a/src/containers/multiple/multiple.container.tsx +++ b/src/containers/multiple/multiple.container.tsx @@ -21,7 +21,7 @@ export interface IMultipleProps extends IComponentProps { */ export const Multiple: React.FC = props => { const {component, form, path, value = [], setValue} = props; // FIXME: Awaits future pr. - const [keys, setKeys] = useState(Array.from({length: 1}, (_, i) => i)); + const [keys, setKeys] = useState([0]); /** Finds next key by increasing the max key with 1. */ const getKey = (): number => { @@ -47,7 +47,7 @@ export const Multiple: React.FC = props => { /** Renders individual components utilizing . */ const renderComponents = () => - Array.from({length: keys.length}, (_, index) => { + keys.map((key, index) => { // Clone and adjust component to fit nested needs. const renderable: IRenderable = { ...structuredClone(component), @@ -58,7 +58,7 @@ export const Multiple: React.FC = props => { }; return ( - + @@ -79,7 +79,7 @@ export const Multiple: React.FC = props => { -