From eb87c0d61dd89bb4fb27fad3754f6383a41afb66 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sun, 4 Jun 2023 16:02:45 +0200 Subject: [PATCH] Try fix comparaison type --- src/components/timeline/TimelineCard.tsx | 2 +- src/components/timeline/TimelineElement.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/timeline/TimelineCard.tsx b/src/components/timeline/TimelineCard.tsx index d909011..b3c755f 100644 --- a/src/components/timeline/TimelineCard.tsx +++ b/src/components/timeline/TimelineCard.tsx @@ -9,7 +9,7 @@ function TimelineCard({ children } : TimelineCardProps) { let titles : ReactNode[] = [] let childrens : ReactNode[] = [] Children.forEach(children, (c) => { - if (c.type.name === "TimelineCardSummary") { + if (c.type === TimelineCardSummary) { titles.push(c) } else { childrens.push(c) diff --git a/src/components/timeline/TimelineElement.tsx b/src/components/timeline/TimelineElement.tsx index 6aa75dc..1ec5f1c 100644 --- a/src/components/timeline/TimelineElement.tsx +++ b/src/components/timeline/TimelineElement.tsx @@ -1,5 +1,6 @@ import './TimelineElement.scss' import react, {Children, ReactNode} from 'react' +import TimelineLabel from './TimelineLabel' type TimelineElementProps = { children: react.ReactElement>[] @@ -9,7 +10,7 @@ function TimelineElement({ children } : TimelineElementProps) { let labels : ReactNode[] = [] let cards : ReactNode[] = [] Children.forEach(children, (c) => { - if (c.type.name === "TimelineLabel") { + if (c.type === TimelineLabel) { labels.push(c) } else { cards.push(c)