-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Labels
Description
Right now the useFetch hook only supports basic GET requests since it only accepts an URL as parameter. For the hook to be generally useful it should at least support all parameters of the Fetch API, like a config object containing request method, body, headers etc.
Also, the hook expects JSON data as the response which limits the use of the hook. I think the hook should not assume JSON data is being fetched and should just return the Response object instead. Another option could be to use a generic type to determine the return value.
I would love to read other's opinion on this matter.
Reactions are currently unavailable