-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Inappropriate Use of Window Reload in updatePostHandler Function #1002
Comments
@palisadoes , Please assign me this issue. |
What is your proposed solution? @rishav-jha-mech may have comments too. |
@palisadoes , My approach is simple. Here is my approach. |
@palisadoes , I found the same issue with the login functionality also. Here you can see in the video that how after hitting the login button it redirects user to the same login page and after full reloading it redirects to the application. 2023-10-24.06-42-59.mp4Should I create a new issue for this? |
@skbhagat0502 the issue you are addressing comes under Post Feed management and currently @aashimawadhwa has an open PR for that. Before opening any PRs, make sure you are assigned the issue, please read the contributing guidelines. |
@skbhagat0502 I'm going to close this, however there are other places in the app where we have to refresh the page after updating values. Creating a standardized methodology to eliminate this need would be good for the project. |
Issue Description:
Context:
The updatePostHandler function in the orgPostCard component contains a call to window.location.reload() after a post update. In Single Page Applications (SPAs), this practice is not ideal as it disrupts the seamless user experience that SPAs aim to provide.
Issues Identified:
Full Page Reload:
The use of window.location.reload() results in a full page reload. In SPAs, this can lead to a loss of the benefits associated with dynamic content updates without full page reloads.
setTimeout Usage:
The use of setTimeout to delay the page reload raises concerns. In SPAs, it's generally preferred to handle timing and side effects using React's useEffect hook for better control but here the setTimeOut is not required though.
Loss of SPA Advantages:
Reloading the entire page contradicts the principles of Single Page Applications, where the goal is to provide a smoother and more dynamic user experience.
The same issue can be seen with the deletePost
Here also after deleting a post the full page reloads and with a setTimeOut.
The text was updated successfully, but these errors were encountered: