Skip to content

Const

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

const root = createRoot()

const Component = () => {
  return (
    <Const name="data">
        test
    </Const>
  )
}

root.render(<Component />)
root.output
//   ^?
typescript
const data = "test"

API

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

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

Released under the MIT License.