Questions tagged [react-router-component]

110 questions
3
votes
2 answers

Separating two different UI in react application

I want to build a react application where there will be two types of UI, one for admin and other for user. All the files included in header and footer will be separate. how can I achieve this? Approach 1 Creating two separate application for admin…
Ganesh Patil
  • 68
  • 1
  • 7
3
votes
3 answers

CSS not working for nested routing in react js

I am new to working with frontend and react js. I have installed a template in my application. index.html file contain all links and path for css index.html
shaswat kumar
  • 369
  • 8
  • 19
3
votes
1 answer

How to change react-router-component context root

I changed the web application deployment context path from / to /foo in web.xml, and react-router-component (not react-router) stopped working, giving the following error Uncaught Error: React-router-component: No route matched! Did you define a…
3
votes
4 answers

React Router master-detail: children component don't render new view until page refresh

I am creating a master-detail navigation just like the example here the react router example; I have a container component OneCheckpointContainer, which renders a navigation panel CheckpointNav (the links), and a data component OneCheckpointData…
3
votes
2 answers

How to combine JSX component with dangerouslySetInnerHTML

I'm displaying text that was stored in the database. The data is coming from firebase as a string (with newline breaks included). To make it display as HTML, I originally did the following:

Nick ONeill
  • 7,341
  • 10
  • 47
  • 61
3
votes
1 answer

React Routing gives Unexpected Token Error

I am trying to create routes for my React application with react-router-component. But when I build my project with webpack, I get the error: ERROR in ./app/js/client.jsx Module build failed: Error: Parse Error: Line 22: Unexpected token < The…
CascadiaJS
  • 2,320
  • 2
  • 26
  • 46
3
votes
2 answers

React Router conditioning by Route

I'm using React Router for server side rendering and I'd like to run a special action on certain Route, actually on DefaultRoute. How should I create condition for that? I tried following code: var React = require("react"); var Router =…
3
votes
2 answers

React component this.props is always empty

I've followed a couple of examples in an attempt to get access to a parameter from a Route in the React component that handles it. However the result of console.log on this.props from inside the render or componentDidMount is always {} when I'd…
Tom
  • 2,734
  • 2
  • 22
  • 39
2
votes
3 answers

NavLink component doesn't let the website render and shows weird errors with all the elements within it

Navbar.jsx code: import React from "react" import {NavLink} from "react-router-dom"; const Navbar = ()=>{ return( <>
2
votes
0 answers

Uncaught TypeError: Cannot read properties of undefined (reading 'param')

It's HomePage component of react js import React from 'react'; import axios from 'axios'; import { useState, useEffect } from 'react'; import { useNavigate,useParams } from 'react-router-dom'; import { Main } from…
2
votes
1 answer

I am trying to created a nested for a child component

i am trying to something like this: } /> } > }…
2
votes
1 answer

Conditional rendering of useContext

The task requires me to fetch data from an API, based on target category groups. For example, www.localhost:8000/women fetches all data corresponding to women, and www.localhost:8000/women fetch all data corresponding to men. I have now created a…
2
votes
2 answers

React Router: The Router only loads / path and does not load any other path

I am trying to load paths from react-router-dom using the Route but it is only fetching the "/" path, It does not load any other path, the authentication logic was working fine before but with routing nothing seems to be working, If I add any other…
2
votes
2 answers

How to display different styled Navbars on different pages in ReactJS?

I have three different Navbars. Each of them is a different component. ,which is for public pages such as LandingPage, DiscoverPage etc. ,which is for SignInPage, SignUppage, VerificationPage etc.
2
votes
2 answers

Load a component on click of a link

How can I load a particular component inside my div column when a link is cliked on left column of div.