I am building a custom hook and I want to set the state type the same as the initial state type
const useCustomHook = (initialState)=>{
...
const [state,setState] = useState<someDynamicType>(initialState);
...
}
How can I do this? Initial state could be anything and not always the same type