-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 BUG: Data from Custom hook does not re-render when data loads #52
Comments
Heya @tyler-morales Can I look into this :)? |
hey @tyler-morales can i try this ? |
#53 Hey @tyler-morales... Can I have a look into this?? |
@inovux yes, you can work on this |
@tyler-morales awesome thanks! I tryed running the project, locally but it seems like it wont let me start it. Is there anything that I have to set up before running |
Yes, check out my comment with an aws-exports file here Let me know if you have any further issues |
@tyler-morales awesome thanks lemme try! |
@tyler-morales I dont think this will be fixable with the current infrastructure of the app. It is re-rendering a lot in unexpected ways. I would suggest having a container or global store to hold the state of the app. The main problem now is that the hooks are using asynchronous functions and the data of the asynchronous functions is checked again with other asynchronous hooks inside the component. This probably needs some changes e.g. passing properties to the Let me know if you think its a good idea to rework the way the state is managed right now. If you think there is a solution to this bug with the current infrastructure let me know what you have in mind :) |
Thanks for your help @inovux. I appreciate you going through my code and taking the time to look for a possible solution. This is the largest codebase I have ever worked on and the first time I really dive into React. Because of this, I am totally open to hearing about new and better ways to organize the app's state. I spend too many hours trying to get my custom hooks to work together all the while being asynchrous, so if you want to update any parts of this, I am happy to hear you! |
In the Game Activity tile, the expected behavior inside the "GAME ACTIVITY STATS" should read out the current date and the number of games played on that date.
Currently, when I call the custom hook to fetch the number of games, the hook only returns
0
even when there exist games. The number of games only appears if a user clicks the day in the heatmap. The number of games should appear on page load for the current date.The file that needs fixing is
ChartHeatmap.js
and you might want to look atuseLoadSpecficRecords.js
Acceptance Criteria:
Below: This is incorrect. The number of games played should be
2
.2
only appears once October 22 is clicked in the heatmap.Let me know if you have any issues or questions. You'll need an aws-exports file if you work on this issue. That can be found in the other current issue in this repo.
The text was updated successfully, but these errors were encountered: