@neew18
Submitted
Hi I finished this challenge and I've got a question. How can I make api call by default like as soon as you open the link? I hardcoded an advice for now. Please review my code and give some advice. I appreciate it. Thank you
@shihabmunshi06
@neew18
Submitted
Hi I finished this challenge and I've got a question. How can I make api call by default like as soon as you open the link? I hardcoded an advice for now. Please review my code and give some advice. I appreciate it. Thank you
@shihabmunshi06
Posted
you can use conditional rendering, when you have the data you set your fetchingDone state to true (we are using a useState hook here) and the elements will be shown on the page
As far as I know it might take some time to fetch the data when you open a page and submit a request so there might be no IMMEDIATE rendering, you can use a loading spinner or some text if you want to show the fetched data and your page together
you can check my solution as i am using some messages as I am loading the data
Marked as helpful
@Clemcy9
Submitted
Thank God I'm finally done after a week of coding and debugging. I still have some problems I'll like to share with this lovely community for help: #1. how to add windows listener to react components #2. How to code a responsive modal in react.
thank you in advance for your comments.
@shihabmunshi06
Posted
This comment was deleted