Coding at Dawn
Published in

Coding at Dawn

What Is the Correct Type for the Children Prop in React TypeScript?

The answer is surprisingly easy, but I see people get it wrong all the time. Here’s what you need to know about using React’s children prop with TypeScript. (Spoiler: It’s React.ReactNode.)

Photo by James Wheeler on Unsplash

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dr. Derek Austin 🥳

I love working with Next.js + Tailwind CSS ♦ Lead Frontend Developer ♦ React Software Engineer ♦ SEO & Web Performance Expert ♦ I love accessible websites