Try fix comparaison type
This commit is contained in:
parent
d5be14fa65
commit
eb87c0d61d
2 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue