headlamp
headlamp copied to clipboard
useList, useGet hooks unexpected behaviour & UseList items any type
Some time ago, I wrote about not being able to know the loading status of a request, so someone from headlamp team told me that in these hooks, null values are default values, so if value is null then it is loading. It worked with useList everywhere, but recently I needed to use same logic with useGet and it behaves differently, useGet always returns null when request has 404 status(resource not found) and also from the start as a default value.
Also, it is worth to mention that "any" type in useList items return is kinda bad thing.
One more thing, just a thought, maybe headlamp should have react-query under the hood and use it in its hooks ?
It would make dealing with requests and streams much easier.
Thanks @callmevladik for reporting this I will take a look into this
@ashu8912 Maybe this has to do with #1591 .