@fayax555
Posted
It's better to use getStaticProps
when the api data doesn't change often since it is much faster than getServerSideProps
. But I guess it doesn't matter much here, since you cleverly hide the loading state with a nice animation.
Marked as helpful
@BenjaDotMin
Posted
@fayax555 A really useful insight, thank you
@fayax555
Posted
@BenjaDotMin Yea if you look at my solution, you can see the country information loads instantaneously because I use getStaticProps instead of getServerSideProps.