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

[Home](./index.md) &gt; [@datashaper/react](./react.md) &gt; [useModalState](./react.usemodalstate.md)

## useModalState() function

A hook to consolidate view-state for modals

<b>Signature:</b>

```typescript
export declare function useModalState(onShow?: (() => void) | undefined, onHide?: (() => void) | undefined): ModalState;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  onShow | (() =&gt; void) \| undefined | <i>(Optional)</i> |
|  onHide | (() =&gt; void) \| undefined | <i>(Optional)</i> callback to be called when the modal is dismissed |

<b>Returns:</b>

[ModalState](./react.modalstate.md)

The modal state

