If your frontend and dashboard are two separate React apps running on different ports, navigating between them can be straightforward. Since they’re essentially two different web apps, you’ll need to redirect the user from one app to the other by sending them to the dashboard’s URL.
Here’s how you can handle it:
Redirecting to the Dashboard In your frontend React app, when the user clicks on the "Dashboard" option, you can redirect them to the dashboard's URL. You don’t need to hardcode the URL if you define it dynamically in your app's configuration.
For example:
// Inside your frontend React component
const goToDashboard = () => {
window.location.href = "http://localhost:5174"; // Replace with your dashboard's URL
};
// In your component's JSX
<button onClick={goToDashboard}>Go to Dashboard</button>
When the user clicks the button, they’ll be redirected to the dashboard app running on port 5174.