Firstly, on the initial load we should not see the text, that there is no countries. We should show a spinner.
Secondly, when we open details page and then return to the home page we should not load countries again. We should store them and reuse. We can use React Context for this, or move the state on a higher level, or try to use any state management library. It's up to you. But there is no sense to retrieve data more than once.
Firstly, on the initial load we should not see the text, that there is no countries. We should show a spinner.
Secondly, when we open details page and then return to the home page we should not load countries again. We should store them and reuse. We can use React Context for this, or move the state on a higher level, or try to use any state management library. It's up to you. But there is no sense to retrieve data more than once.