Whats the point of this ternary operator in the nextjs homepage of Create T3 App?
I thought i knew my nextjs, but there is a while hello is
Isnt that await supposed to work like the old "getServersideProps"? when would that Loading state be visible? because i couldnt even get it to trigger locally (it always just shows the greeting).
3 Replies
hey what you are checking is if the data exist not if the data is loading
to show loading state you can use react supense for that
so here is what you are doing
here is how you can do it https://react.dev/reference/react/Suspense
– React
The library for web and native user interfaces
Thank you for the answer, i understand the Suspense stuff, however this is not my code, this is default code for the nextjs application in Create T3 App, and im confused on why it works that way considering hello will never be null/undefined