Skip to content
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

Replace window.location.href with useNavigate() in PatientHistory.js to Avoid Hard Refresh #1465

Open
BhanuPrakash2047 opened this issue Jan 29, 2025 · 4 comments
Assignees

Comments

@BhanuPrakash2047
Copy link

BhanuPrakash2047 commented Jan 29, 2025

Problem Statement:
Currently, the application uses window.location.href for navigation in the PatientHistory.js component, which causes a hard refresh (full page reload). This approach is inefficient and disrupts the Single Page Application (SPA) behavior, leading to a poor user experience.

Location to Update:

File: OpenELIS-Global-2/frontend/src/components/patient/PatientHistory.js
After redirection, the application uses the component: frontend/src/components/patient/resultsViewer/results-viewer.tsx

Proposed Solution:

Replace window.location.href with the useNavigate() hook provided by React Router v6. This will enable client-side navigation without triggering a hard refresh.

Advantages:

=>Avoid Hard Refresh: The application will no longer reload the entire page during navigation, improving performance and user experience.
=>SPA Behavior: Maintains the SPA architecture, ensuring a seamless and faster navigation experience.
=>No Side Effects: This change is isolated and does not impact other components or functionality.

@mozzy11
Copy link
Collaborator

mozzy11 commented Jan 30, 2025

Thanks @BhanuPrakash2047 .
Can you work on this ??

@mozzy11 mozzy11 moved this from Todo to In Progress in Introductory Issues Jan 30, 2025
@BhanuPrakash2047
Copy link
Author

Yes i can work this issue.

@mozzy11
Copy link
Collaborator

mozzy11 commented Jan 30, 2025

you can also look into other places where this isbeing used in the source code

@BhanuPrakash2047
Copy link
Author

sure, i will look into remaining places and i will edit them in source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants