From d5dd6c68053c0a5cdc052bf888ce235ccfa7dcc4 Mon Sep 17 00:00:00 2001 From: Chika Date: Wed, 1 Jun 2022 14:19:33 +0300 Subject: [PATCH] render: fix Warning: Each child in a list should have a unique "key" prop. --- Components/Calculation/config/elements-render.tsx | 2 +- Components/Calculation/layout/renderSections.tsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Components/Calculation/config/elements-render.tsx b/Components/Calculation/config/elements-render.tsx index 313d920..9d0416a 100644 --- a/Components/Calculation/config/elements-render.tsx +++ b/Components/Calculation/config/elements-render.tsx @@ -60,7 +60,7 @@ const renderElements = (Object.keys(map) as (keyof typeof map)[]).reduce((acc, e acc[elementName] = { render: () => ( - + diff --git a/Components/Calculation/layout/renderSections.tsx b/Components/Calculation/layout/renderSections.tsx index 790ad85..6760ced 100644 --- a/Components/Calculation/layout/renderSections.tsx +++ b/Components/Calculation/layout/renderSections.tsx @@ -3,7 +3,7 @@ import elementsRender from '../config/elements-render'; import type { SectionsConfig } from '../types/sections'; function renderSections(config: SectionsConfig) { - const rows = config.map(([elements, style]) => { + const rows = config.map(([elements, style], i) => { const renderedElements = elements.map((elementName) => { const render = elementsRender[elementName]?.render; @@ -12,6 +12,8 @@ function renderSections(config: SectionsConfig) { return (