diff --git a/packages/react/src/hooks/useStepHandlers.ts b/packages/react/src/hooks/useStepHandlers.ts index 6ca45a9c..7af5828a 100644 --- a/packages/react/src/hooks/useStepHandlers.ts +++ b/packages/react/src/hooks/useStepHandlers.ts @@ -40,16 +40,18 @@ export function useStepHandlers(step: FlowStep, { onPrimary, onSecondary }: Step step == null ? {} : { - 'flow.back': () => step.flow.back(), - 'flow.complete': () => step.flow.complete(), - 'flow.forward': () => step.flow.forward(), + 'flow.back': (properties?: PropertyPayload) => step.flow.back(properties), + 'flow.complete': (properties?: PropertyPayload) => step.flow.complete(properties), + 'flow.forward': (properties?: PropertyPayload) => step.flow.forward(properties), 'flow.restart': () => step.flow.restart(), - 'flow.skip': () => step.flow.skip(), - 'flow.start': () => step.flow.start(), - 'step.complete': () => step.complete(), - 'step.skip': () => step.skip(), + 'flow.skip': (properties?: PropertyPayload) => step.flow.skip(properties), + 'flow.start': (properties?: PropertyPayload) => step.flow.start(properties), + 'step.complete': (properties?: PropertyPayload, optimistic?: boolean) => + step.complete(properties, optimistic), + 'step.skip': (properties?: PropertyPayload, optimistic?: boolean) => + step.skip(properties, optimistic), 'step.reset': () => step.reset(), - 'step.start': () => step.start(), + 'step.start': (properties?: PropertyPayload) => step.start(properties), }, [step] ) diff --git a/yarn.lock b/yarn.lock index b9062ea2..05730da9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3856,6 +3856,7 @@ __metadata: "@changesets/cli": "npm:^2.22.0" eslint: "npm:^7.32.0" eslint-plugin-react-hooks: "npm:^5.1.0" + husky: "npm:^9.1.7" prettier: "npm:^2.5.1" rimraf: "npm:^5.0.0" turbo: "npm:^1.10.14" @@ -13609,6 +13610,15 @@ __metadata: languageName: node linkType: hard +"husky@npm:^9.1.7": + version: 9.1.7 + resolution: "husky@npm:9.1.7" + bin: + husky: bin.js + checksum: 10/c2412753f15695db369634ba70f50f5c0b7e5cb13b673d0826c411ec1bd9ddef08c1dad89ea154f57da2521d2605bd64308af748749b27d08c5f563bcd89975f + languageName: node + linkType: hard + "iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24"