skip to Main Content

Reactjs – In prop passing through children, how to align type to it

Problem: when I use below expression, IDE alerts typescript syntax error. I think typescript expects children to be assigned as ReactNode not as Array<object>. ----/page.tsx/---- ... <TopBar>{[ {text:"career",href:"",class:"p-0 m-0"}, {text:"contact",href:"",class:"p-0 m-0"}, {text:"patient registry",href:"/patient_registry",class:"custom-outline p-1 rounded-2xl px-4 hover:bg-black hover:text-white"} ]}</TopBar> ...…

VIEW QUESTION
Back To Top
Search