Skip to content

Instantly share code, notes, and snippets.

@DoctorDerek
Created October 21, 2022 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DoctorDerek/8b5d24428b1dbfbe4c297cc866c29762 to your computer and use it in GitHub Desktop.
Save DoctorDerek/8b5d24428b1dbfbe4c297cc866c29762 to your computer and use it in GitHub Desktop.
What Is the Correct Type for the Children Prop in React TypeScript? https://medium.com/p/6974e82917b4
import React from "react"
interface ILayout {
pageInfo?: { name: string; description: string }
children:
| JSX.Element[]
| JSX.Element
| React.ReactElement
| React.ReactElement[]
| string
}
export default ILayout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment