Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Hooks

Some hooks that can be used with@kubb/react.

useLifecycle

useLifecycle will return some helpers to exit/restart the generation.

tsx
import { useLifecycle } from '@kubb/react'function Component() {  const { exit } = useLifecycle()  return null}

useApp

useApp will return the current App with plugin, pluginManager, fileManager, mode, ...

tsx
import { useApp } from '@kubb/react'function Component() {  const { pluginManager, plugin, mode, exit, getFile, fileManager} = useApp()  return null}

useFile

WithuseFile you can get the context of the current file(basePath, name, ...)

tsx
import { File, useFile } from '@kubb/react'function Component() {  const pluginName = 'custom-plugin'  const file = useFile()  return file.baseName}

Contributors

The avatar of contributor named as Stijn Van Hulle Stijn Van Hulle
The avatar of contributor named as Pavel Surkov Pavel Surkov

Changelog

f1b133f-chore: change import name in @kubb/react hooks docs
23b8137-chore: examples for @kubb/react (#1388)
e246cc0-docs: cleanup docs(spelling + old knowledge base pages being removed)
bf9700d-docs: api page
6436c1e-docs: update docs with one main docs page
dafd183-docs: resolve twoslash
49407d7-chore: update docs
4b52765-Chore/rename imports (#986)
d6985e5-chore: add interactive docs (#967)
2f3f3ea-Fix/907 (#911)
d9191db-Zod operations and paths (#898)
994d7f5-Type generator (#871)
efa7c75-Support mutate with params (#835)
8314cb8-docs: plugin system
48b7ff2-Feat/swagger infer (#678)
d9fb6fb-Feat/client templates (#647)

[8]ページ先頭

©2009-2025 Movatter.jp