Skip to content

Type ​

tsx
import React from "react"
import { createRoot, Type } from '@kubb/react'

const root = createRoot()

const Component = () => {
  return (
    <Type name="Data">
      string
    </Type>
  )
}

root.render(<Component />)
root.output
//   ^?
typescript
type Data = string

API ​

tsx
import React from "react"
import { Type } from '@kubb/react'

type Props = React.ComponentProps<typeof Type>
PropertyDescriptionTypeDefault
nameName of the type, this needs to start with a capital letter.string-
exportDoes this type need to be exported.boolean | undefined-
JSDocOptions for JSdocsJSDoc | undefined-
childrenKubbNode | undefined-

Released under the MIT License.