samit4me / react-async-ts-issue

Demo typing issue with react-async and typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Summary

In a nutshell, both of the following usages of useAsync are throwing TypeScript errors, see src/User.tsx for further details.

const { data, error, isPending } = useAsync(dataFetching, { id: 1 });

const { data, error, isPending } = useAsync({ promiseFn: dataFetching, id: 1 });

This project was bootstrapped with Create React App.

yarn start

About

Demo typing issue with react-async and typescript


Languages

Language:TypeScript 74.7%Language:HTML 16.5%Language:CSS 8.9%