Status: {tour.state.status}
> ) } ``` The hook returns the state and the controls: `start`, `resume`, `next`, `back`, `skip`, `goTo` and `notify`. The tour is created once and cleaned up when the component unmounts. It is recreated only when the tour’s `id` or `version` changes. Define tours outside your components, or memoize them, so they are not rebuilt on every render. ## Your own popover [Section titled “Your own popover”](#your-own-popover) Pass a render function as `popover`. Your component renders inside the box Docent positions, through a portal, so context, hooks and your CSS all work as usual. Render `tour.portal` once, anywhere in your tree. ```tsx import type { RenderContext } from '@docentjs/react' function Card({ ctx }: { ctx: RenderContext }) { return ({ctx.step.body}
Status: {$state.status}
``` Call `destroy` when the component goes away, as above. ## Your own popover [Section titled “Your own popover”](#your-own-popover) Pass a component as `popover`. Docent mounts it into the box it positions for every step, with `ctx` as a prop, and unmounts it before the next one. ```svelte ``` Card.svelte ```svelte{ctx.step.body}
Status: {{ tour.state.value.status }}
``` `state` and `active` are refs. The composable also returns the controls: `start`, `resume`, `next`, `back`, `skip`, `goTo` and `notify`. Called inside `setup()`, the tour is cleaned up with the component. Outside a component, call `tour.destroy()` yourself. ## Your own popover [Section titled “Your own popover”](#your-own-popover) Turn on headless mode with `popover: true` and place a `