Category "react-router"

Testing React Component with React Router V6

I understand that React Testing Library has an example of testing with react router, but I couldn't get it to work (I think because I am using react router V6).

react-router-dom v6 StaticRouter context is not working

I'm trying to make SSR React web application. Everything works fine except staticContext. My server code is // IMPORTS const renderer = (req, store, context) =

React - pass context to SweetAlert popup

My context is as follows: import React, {createContext, useEffect, useState} from "react"; export const CartContext = createContext(); const CartContextProvid

React-router-dom v6 params

How do I create a route in react using react-router-dom v6? Currently I'm trying: <Route path="/registration:id" element={<Registration />} /> With

React-router showing invalid hook call

An invalid hook error occurred in my react app caused by react-router but I can't seem to detect where it's coming from. The full error reads as follows: Error:

How to add title of a article into URL in Reactjs?

I am trying to know if it is possible or not to add the title of an article into the URL after redirecting to a specific article? An example: https://www.analyt

Property 'exact' does not exist on type

I am trying to use react-router-dom inside my react app and also I am using typescript instead of javascript. The issue here is that I can't import Route inside

Matched leaf route at location "/" does not have an element

Matched leaf route at location "/" does not have an element. This means it will render an with a null value by default resulting in an "empty" page //App.js Fi

Split Routes inside a single Switch into multiple components

I'm using React Router v5 and I ran into problems when trying to define routes split across multiple components. The case I tried is something like the followin

React application built on top of firebase renders 404 on page refresh

We have a React App built on top of firebase. The problem we are facing is if you change the url by navigating to a different page other than the root '/', then

React/TypeScript app fails to deploy to subdomain (404)

Hi I made react typescript app. Everything works perfect on localhost and domain, but when I upload same build folder to the subdomain i have 404 error. My .hta

Next.js router.query getting undefined on refreshing page, but works if you navigate to it from Link component [duplicate]

Why is router.query empty when I refresh a page with the correct id in the URL, but when when I navigate towards it through , it works? say I

React Components Rendering Error in Electron-React-Boilerplate

Good Afternoon all, I built a React.js web music-player application a while ago, and now I am transforming my old react application into a downloadable des

React: How to get current Route path on each route change? React-router v5

The following code is giving base route instead of nested routes or I can say the current route function test() { const route = useRouteMatch(); useEffect((

React: How to get current Route path on each route change? React-router v5

The following code is giving base route instead of nested routes or I can say the current route function test() { const route = useRouteMatch(); useEffect((

How to debug npm ERR! errno -4094? [duplicate]

I'm doing my first React project, and following the MOOC instructions, I've had to create routes by this command : npm install react-router-do

ReactJS app inside Laravel's public folder .htaccess configurations

I am hosting a React application inside the public directory of a Laravel app where: /public_html/ app bootstrap config

Deploy create-react-app with react routing to cpanel

So I am trying to deploy a create-react-app app to cPanel .My biggest issue is having the server respond to a request because all I am getting when refreshing o

Nginx Proxy_pass / redirect to fixed url

I created a simple react app to serve as an error page (might be a bit overkill). The idea is that we can easily customize the errors via query parameters or UR

Custom domain name for github pages only works for homepage, all other 404

I just linked a custom domain I got from google domains to a github pages react app. Currentely, when I go to the custom domain, the homepage of the website wor