Skip to content

Instantly share code, notes, and snippets.

@john-osullivan
Last active September 16, 2019 18:00
Show Gist options
  • Save john-osullivan/0212d49249354776709c167a2985a951 to your computer and use it in GitHub Desktop.
Save john-osullivan/0212d49249354776709c167a2985a951 to your computer and use it in GitHub Desktop.
Dev Diaries #2 - Type Factory in useState
export function LoginScreen(props) {
const [loginArgs, setLoginArgs] = React.useState(Login.newArgs());
async function submitLogin() {
const res:Login.Response = await DappbotAPI.auth.login.call(loginArgs);
...
}
return (
...
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment