Skip to content

Parser ​

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

const root = createRoot()

const Component = () => {
  return (
    <Parser language="text">
      export const test = 2
    </Parser>
  )
}

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

API ​

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

type Props = React.ComponentProps<typeof Parser>
PropertyDescriptionTypeDefault
languageName of the language used.typescript' | 'text' | string-
childrenKubbNode | undefined-

Released under the MIT License.