There’s a few different ways to approach it, but the simplest in your example would be to type the return type of the useState function:
let (user, setUser) = React.useState((_): loadable<user, 'a> => Loading)
There’s a few different ways to approach it, but the simplest in your example would be to type the return type of the useState function:
let (user, setUser) = React.useState((_): loadable<user, 'a> => Loading)