Try fix comparaison type

This commit is contained in:
Florian RICHER 2023-06-04 16:02:45 +02:00
parent d5be14fa65
commit eb87c0d61d
2 changed files with 3 additions and 2 deletions

View file

@ -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)

View file

@ -1,5 +1,6 @@
import './TimelineElement.scss'
import react, {Children, ReactNode} from 'react'
import TimelineLabel from './TimelineLabel'
type TimelineElementProps = {
children: react.ReactElement<any, react.JSXElementConstructor<any>>[]
@ -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)