Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Control the URL bar with JavaScript

Is there some function in javascript or React.js to tell if a user tries to access an existing page through the URL bar?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

In plain javascript: window.history How do I modify the URL without reloading the page?

In React, use should use React Router along with useHistory hook : https://reactrouter.com/web/guides/quick-start

about 4 years ago · Juan Pablo Isaza Report

0

You can use useHistory hook:

import {useHistory} from “react-router-dom”

Then :

const {location} = useHistory()
console.log(location.pathname)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!