@appbuckets/react-ui
Version:
Just Another React UI Framework
21 lines (20 loc) • 621 B
TypeScript
import * as React from 'react';
import type {
CollapsableState,
CollapseStateChangeHandler,
} from '../Collapsable';
export declare type UseCollapsableStateReturn = [
undefined | CollapsableState,
CollapseStateChangeHandler,
React.Dispatch<React.SetStateAction<CollapsableState | undefined>>
];
/**
* Use this hook to get automatically the open value
* and the handler function to attach to collapsable element.
* Additionally function to force change will be returned
*
* @param initialState
*/
export declare function useCollapsableState(
initialState?: CollapsableState
): UseCollapsableStateReturn;