SWR - If loading is false and error is undefined, what can we assume?
If
isLoading
is false and error
is undefined, can I assume data
is not undefined? (using typescript)
Is it ok to always have to use data like this data?.something
(since it is possibly undefined).
Is there a more standard way to know for sure when data
is ready to be used on the UI? Should I always do something like data && <Component/>
?
Thanks!0 Replies