Skip to main content

All Questions

-1 votes
2 answers
926 views

How to retain scroll position at top when navigating between pages? [duplicate]

I'm encountering an issue in my ReactJS application where, upon navigating to a new page, the page automatically scrolls down to a position below the top of the page instead of starting from the top (...
Ricky 's user avatar
  • 712
-1 votes
1 answer
98 views

Rendering different component based on dropdown selection

I am working on a dashboard in which there is a main menu with multiple options. When the user selects a menu option, it will take them further to a dropdown menu. The dropdown menu will have ...
Kavin's user avatar
  • 41
1 vote
0 answers
40 views

Link in React doesn't forward to a new page [duplicate]

My question might seem stupid because I don't have enough background in React JS. Consider the code : class App extends React.Component { render() { return ( <div className='...
Maxim's user avatar
  • 9
0 votes
1 answer
314 views

React: Pass data from a component back to App.js

I am trying to pass User information from a child component to App.js as we have a user icon within the App.js itself App.js import * as React from 'react'; import { BrowserRouter } from 'react-router-...
SM079's user avatar
  • 783
0 votes
0 answers
97 views

ReactJs problem about Path Import Start from "./Start"

Project\frontend>npm run dev [email protected] dev vite VITE v4.3.9 ready in 704 ms ➜ Local: http://localhost:5173/ ➜ Network: use --host to expose ➜ press h to show help Failed to resolve ...
Bouazzaoui Mohamed's user avatar
1 vote
1 answer
27 views

I am learning RECT and at the moment of using a component it is placed under the first component

As it says in the title I am learning so I want to do this import Navbar from "../components/navbar"; import Footer from "../components/footer"; import Contactanos from "../...
Sebitas Aldas's user avatar
0 votes
1 answer
44 views

React: usenav hooks works for a sec and then page reloads back to login page

`I have been trying to create a simple login page which uses Login API. I have used usenav hook but when I login successfully I can see the usenav work for just a sec and the page reloads back to the ...
Prerna's user avatar
  • 1
1 vote
1 answer
104 views

React Router v6 always thinks route is "/"

I'm trying to figure out the basics of React, and I can't find any explanation for the behaviour I'm seeing. When I try to use routes, the app acts as if the path is always "/": no route is ...
Sky Shoesmith's user avatar
1 vote
1 answer
751 views

Showing Data in React Native with useParams

I've the following question, how can I display the data in react-native with useparams? I've the following code snippet in my Details.jsx import React from 'react' import {useParams} from 'react-...
Yordy Mora's user avatar
0 votes
1 answer
84 views

React language issues with it's versions

I am learning to react. I found that I need to install some package to use anything. Does React and Node installation comes empty [No library as we have in Java]? I am using react-router and react-...
Anish Mittal's user avatar
  • 1,182
2 votes
1 answer
53 views

I need that if the pathname matches with the arrays name, a group of photos is visible while the others groups are not

export default function Gallery() { const [projectsData, setProjectsData] = useState(projects); let location = useLocation(); const swiperNavPrevRef = useRef(); const ...
Tontito's user avatar
  • 35
-1 votes
1 answer
95 views

I am getting this error i dont know why "'Switch' (imported as 'Switch') was not found in 'react-router-dom'" [duplicate]

Even though I used Routes instead of switch still its showing the same error ,I installed react dom using the command npm install -S react-router-dom. The code is below import './App.css'; import ...
karan deep's user avatar
2 votes
2 answers
1k views

How to have the useEffect and useLocation hooks sync up correctly in React using React Router?

I am making an app where mousewheel up and down are used to navigate to and from different pre set routes. currently the routes look like this: main -> skills -> aboutme -> work mousewheel-...
jacksonmendoza's user avatar
1 vote
1 answer
2k views

Redirection after login in React Native using Navigation

Hi i am trying to navigate to dashboard screen after successfull login by setting token to asyncStorage, I am able to set token in asyncStorage but not able to navigate to dashboard after successfull ...
user avatar
1 vote
1 answer
765 views

React Native Webview routing from a Webview to another Webview

I'm working on a React Native page that's rendered in a Webview. My problem is that this page (/about) has links that'll open things like /:id but doesn't open them as a Webview. Here's my About ...
Atticus's user avatar
  • 420

15 30 50 per page
1
2 3 4 5
36