ReactJS useParams Hook Last Updated : 14 Aug, 2025 Suggest changes Share Like Article Like Report The useParams hook in React Router provides access to dynamic URL parameters (such as /user/:id). It allows components to retrieve values from the URL, enabling dynamic content rendering based on the route's parameters.Syntaxconst { param1, param2, ... } = useParams();In the above syntax:param1, param2, etc., are the names of the route parameters defined in the path.useParams returns an object where the keys are the parameter names, and the values are the corresponding values from the URL.Now let's understand this with the help of example: JavaScript import React from "react"; import { BrowserRouter as Router, Route, Routes, useParams } from "react-router-dom"; function BlogPost() { let { id } = useParams(); return <div style={{ fontSize: "50px" }}>Now showing post {id}</div>; } function Home() { return <h3>Home page</h3>; } function App() { return ( <Router> <Routes> <Route path="/" element={<Home />} /> <Route path="/page/:id" element={<BlogPost />} /> </Routes> </Router> ); } export default App; OutputIn this exampleuseParams is called inside the BlogPost component to fetch the dynamic parameter id from the URL.The URL /post/:id means that the value for id is dynamically passed and can be accessed via useParams. R raman111 Follow Article Tags : Web Technologies ReactJS React-Hooks Explore React Tutorial 5 min read React FundamentalsReact Introduction 6 min read React Environment Setup 3 min read React JS ReactDOM 2 min read React JSX 5 min read ReactJS Rendering Elements 3 min read React Lists 4 min read React Forms 4 min read ReactJS Keys 4 min read Components in ReactReact Components 4 min read ReactJS Functional Components 4 min read React Class Components 3 min read ReactJS Pure Components 4 min read ReactJS Container and Presentational Pattern in Components 2 min read ReactJS PropTypes 5 min read React Lifecycle 7 min read React HooksReact Hooks 8 min read React useState Hook 5 min read ReactJS useEffect Hook 5 min read Routing in ReactReact Router 5 min read React JS Types of Routers 10 min read Advanced React ConceptsLazy Loading in React and How to Implement it ? 4 min read ReactJS Higher-Order Components 5 min read Code Splitting in React 4 min read React ProjectsCreate ToDo App using ReactJS 3 min read Create a Quiz App using ReactJS 4 min read Create a Coin Flipping App using ReactJS 3 min read How to create a Color-Box App using ReactJS? 4 min read Dice Rolling App using ReactJS 4 min read Guess the number with React 3 min read My Profile ${profileImgHtml} My Profile Edit Profile My Courses Join Community Transactions Logout Like