ThoorAdam
useFetch type inference
Hello!
Been using nuxt for a few days now and most things are amazing so far, love the overall DX. I do have one small gripe with useFetch though.
Take the following code
This seems to infer the types, at least somewhat, but it leads to strange linting errors not letting me access the values of the recipe.
However if I do the following and use a generic it does work as i expect it to.
Do I really need to use generics everytime I fetch data to get the correct type inference? Don't get me wrong, it's not the biggest hassle, until I change what data the route returns for example. Then it could mean changing the generic in a lot of places.
7 replies