All Questions
Tagged with reactjs react-router-dom
7,457
questions
-1
votes
1
answer
24
views
React router dom navigate isn't working at useRoutes
export default function Router() {
const [store, dispatch] = useStore();
const handleAppRedirect = () => {
if (store.token === null) {
return <Navigate to="/login" />;...
0
votes
0
answers
35
views
Why do I get errors when I want to go to the Navigation where there is a Hashlink? [duplicate]
Errors
App.jsx
import React, { useRef, useEffect, Suspense, Fragment } from "react";
import { useSelector } from "react-redux";
import { BrowserRouter, Routes, Route } from "...
2
votes
1
answer
31
views
Dynamically creating webpages based on user input [duplicate]
I am working on a project in React for scheduling group meetings. The idea is that users can create a club in the homepage, and then navigate to that club page. A user can be part of multiple clubs. ...
-1
votes
0
answers
15
views
React Router Redirect Issue: Unable to Redirect to Login Page Using react router redirect Function
I created a project using React and React Router DOM to test routing and authentication for specific parts of the page. However, I encountered an unexpected application error that displays the ...
-2
votes
0
answers
25
views
How do deploy vite ssr react app on server? [closed]
I have a problem with the deployment of Vite SSR React assembly on Vercel. Here is the Github repository of the Vite template on which I have a project
https://github.com/bluwy/create-vite-extra/tree/...
1
vote
1
answer
31
views
How do I avoid React Router Link going to the root route '/' before going to the dynamic route?
What I'm trying to do is a search flow in my project using the Reddit API.
User does a search
The Web App returns Subreddits that include the query searched
Every Subreddit component has a Link that ...
-1
votes
0
answers
23
views
How to add a button to go back to home from inside a playing video
I just started exploring react-router and I have a video playing over my page when clicked but then I am
trying to add a button to click from the video to navigate back to the home page but couldn't.
...
0
votes
2
answers
36
views
Page refreshing
I am working on a product website with React and each time I click on a particular menu, it refreshes my entire page instead of just rendering component.
export const Header = () => {
return (
...
-2
votes
0
answers
12
views
React Router v6 Link duplicates paths when also using onClick [closed]
Clicking the same Link element more than once doubles the url params when using with an onClick function that updates state. Removing the onClick makes the Link function as expected.
Expected path ...
0
votes
0
answers
16
views
Pass props to parent route element [duplicate]
I have a <Background /> element upstream of the child pages.
const myRouter = createBrowserRouter([
{
path: '/',
element: <ParentLayout />,
children: [
{
path: ...
-1
votes
0
answers
13
views
Redirection to /login not working in React app with react-router-dom and JWT authentication
For context I am currently following a tutoriel to learn how to create a Django & React Web App.
I am building a React application that uses JWT authentication to protect certain routes. I want to ...
-1
votes
1
answer
41
views
react-router-dom issue with Vite react
I'm setting up react-router-dom in my Vite react app. Everything is running smoothly in dev, but when I rub my build and preview it, Im getting the following error
localhost/:1 Uncaught TypeError: ...
-1
votes
1
answer
24
views
User layout which has protected route does not show on the browser. shows a blank page with navigation and side bars
User layout which iterates the pages in the userroutes file only shows the sidebars and navigation bars. shows a blank page and does not show the content of the pages. the urls of the pages are ...
-1
votes
1
answer
42
views
unable to extract id using useParams in ReactJS [closed]
In my application, I am trying to edit a task, which requires the task id to be done, but for some reason my id does not get extracted using useParams. Below is my EditTask.jsx code, the address bar ...
-2
votes
0
answers
14
views
Using react-router-dom hooks inside a private react package [closed]
I have created a react package containing some global components I wish to use in other applications. In those components I use providers, one of which is react-router-dom. Even though I import and ...