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 titles : ReactNode[] = []
|
||||||
let childrens : ReactNode[] = []
|
let childrens : ReactNode[] = []
|
||||||
Children.forEach(children, (c) => {
|
Children.forEach(children, (c) => {
|
||||||
if (c.type.name === "TimelineCardSummary") {
|
if (c.type === TimelineCardSummary) {
|
||||||
titles.push(c)
|
titles.push(c)
|
||||||
} else {
|
} else {
|
||||||
childrens.push(c)
|
childrens.push(c)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import './TimelineElement.scss'
|
import './TimelineElement.scss'
|
||||||
import react, {Children, ReactNode} from 'react'
|
import react, {Children, ReactNode} from 'react'
|
||||||
|
import TimelineLabel from './TimelineLabel'
|
||||||
|
|
||||||
type TimelineElementProps = {
|
type TimelineElementProps = {
|
||||||
children: react.ReactElement<any, react.JSXElementConstructor<any>>[]
|
children: react.ReactElement<any, react.JSXElementConstructor<any>>[]
|
||||||
|
@ -9,7 +10,7 @@ function TimelineElement({ children } : TimelineElementProps) {
|
||||||
let labels : ReactNode[] = []
|
let labels : ReactNode[] = []
|
||||||
let cards : ReactNode[] = []
|
let cards : ReactNode[] = []
|
||||||
Children.forEach(children, (c) => {
|
Children.forEach(children, (c) => {
|
||||||
if (c.type.name === "TimelineLabel") {
|
if (c.type === TimelineLabel) {
|
||||||
labels.push(c)
|
labels.push(c)
|
||||||
} else {
|
} else {
|
||||||
cards.push(c)
|
cards.push(c)
|
||||||
|
|
Loading…
Reference in a new issue