diff --git a/.changeset/typed-flow-render-props.md b/.changeset/typed-flow-render-props.md new file mode 100644 index 0000000..87e6e5d --- /dev/null +++ b/.changeset/typed-flow-render-props.md @@ -0,0 +1,5 @@ +--- +"@useflow/react": minor +--- + +Improve Flow render-prop typing so step IDs, next steps, and explicit next/skip targets are inferred from the flow definition and narrowed by the current step. diff --git a/README.md b/README.md index 0c24f7e..6a82f88 100644 --- a/README.md +++ b/README.md @@ -135,8 +135,8 @@ function BusinessStep() { value={context.company || ""} // 💡 TypeScript knows this is a string onChange={(e) => setContext({ company: e.target.value })} /> - Back - Continue + back()}>Back + next()}>Continue ); } diff --git a/apps/docs/astro.config.mjs b/apps/docs/astro.config.mjs index 91468e8..7748eea 100644 --- a/apps/docs/astro.config.mjs +++ b/apps/docs/astro.config.mjs @@ -124,6 +124,7 @@ export default defineConfig({ { label: "Branching Flows", link: "/guides/branching-flows" }, { label: "Flow Variants", link: "/guides/flow-variants" }, { label: "Persistence", link: "/guides/persistence" }, + { label: "Routing", link: "/guides/routing" }, { label: "Callbacks", link: "/guides/callbacks" }, { label: "Custom Layouts", link: "/guides/custom-layouts" }, { diff --git a/apps/docs/src/content/docs/api-reference/flow-component.mdx b/apps/docs/src/content/docs/api-reference/flow-component.mdx index d5aedb2..e03a39e 100644 --- a/apps/docs/src/content/docs/api-reference/flow-component.mdx +++ b/apps/docs/src/content/docs/api-reference/flow-component.mdx @@ -330,7 +330,7 @@ const persister = createPersister({ store });