<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@datashaper/react](./react.md) &gt; [useOnSaveStep](./react.useonsavestep.md)

## useOnSaveStep() function

<b>Signature:</b>

```typescript
export declare function useOnSaveStep(workflow: Workflow): (step: Step, index: number | undefined) => void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  workflow | Workflow | The workflow |

<b>Returns:</b>

(step: Step, index: number \| undefined) =&gt; void

A callback to use when saving a step, either new or existing

