From 90162cc2ceedfd8a9d0793c3da9883b6d70d5915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rialland?= Date: Wed, 6 Apr 2022 11:03:49 +0200 Subject: [PATCH] Fix map error --- site/source/components/company/SearchDetails.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/site/source/components/company/SearchDetails.tsx b/site/source/components/company/SearchDetails.tsx index 48804e218..a4076f0fb 100644 --- a/site/source/components/company/SearchDetails.tsx +++ b/site/source/components/company/SearchDetails.tsx @@ -2,7 +2,7 @@ import { FabriqueSocialEntreprise } from '@/api/fabrique-social' import { Spacing } from '@/design-system/layout' import { Strong } from '@/design-system/typography' import { H4 } from '@/design-system/typography/heading' -import { useMemo } from 'react' +import { Fragment, useMemo } from 'react' import { Trans, useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -63,14 +63,14 @@ function highlightLabelToJSX(highlightLabel: string) { const highlightRE = /(.*?)(.+?)<\/u><\/b>/gm let parsedLength = 0 const result = [] - let matches + let matches: RegExpExecArray | null = null while ((matches = highlightRE.exec(highlightLabel)) !== null) { parsedLength += matches[0].length result.push( - <> + {matches[1]} {matches[2]} - + ) } result.push(highlightLabel.slice(parsedLength))