import { UseStateIfMountedParams, UseStateIfMountedParamResponse } from './types.js'; import 'react'; /** * Like React's [useState](https://reactjs.org/docs/hooks-reference.html#usestate) * but it makes sure the component that uses this hook is mounted when updating state * * @param {any} initialValue * @returns {[any, Diapatch]} an array of 2 items * * the first is the current state, the second is a function that enables * updating the state if the component is not mounted */ declare const useStateIfMounted: (initialValue?: UseStateIfMountedParams) => UseStateIfMountedParamResponse; export { useStateIfMounted as default };