useFetch adds null to return type
When using
Because I use typescript strict mode, this forces me to do null checks to api routes which already handle this.
If I understand correctly, when using SSR,
Then why does it add null to the type?
If this works as intended, how would I check if the data is null inside
useFetch to fetch data from server api routes, useFetch adds null as a union to the return type.Because I use typescript strict mode, this forces me to do null checks to api routes which already handle this.
If I understand correctly, when using SSR,
useFetch is just an async function call to the api endpoints?Then why does it add null to the type?
If this works as intended, how would I check if the data is null inside
script setup
