Rest Countries - React, Redux toolkit, Styled Components
Design comparison
Solution retrospective
I would appreciate feedback on the project on things that were done well and those to be improved.
I would also appreciate feedback as regards redux toolkit, right now in my app, I'm using both async thunk and redux query together just because i found it difficult implementing some of the features with query alone.
Any performance tips?
I would also greatly appreciate code review
Community feedback
- @PeshwariNaanPosted about 2 years ago
Hello C. Emmanual - Great job on completing the challenge. Everything looks really good in the presentation and the responsiveness is really smooth.
A couple tips to help you with the efficiency of your code.
- You really don't need redux for a project like this where you really only need to make one api call. There is no need to make more api calls for a search when you already have all the data from the initial call. When you make more calls to the api through redux for a search parameter, you are creating unnecessary re-renders on the page which will decrease the efficiency of your code. For something like this, it is much better to use the useContext api instead. You can implement all the filters on the home page and re-render only the different countries that you want to display and never have to make an additional call to the country api. Same for error handling. Your redux code works fine but it adds a lot of extra code and complexity and there is no benefit for it. There are a lot of resources out there for context vs redux to help you decide which one is the best fit.
-Happy coding
0@cemmanuelonyemaPosted about 2 years agoHello @PeshwariNaan, thank you very much for taking your time to go through my project, it means a lot. So about redux, you are absolutely right, I could have used context api, I basically decided to use redux toolkit just for the sake of learning, it is my first time using it.
So I would refactor well enough to avoid unnecessary api calls, I actually did try to filter from the returned response but was facing issues.
Thank you.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord