ReactJS useParams Hook Last Updated : 14 Aug, 2025 Comments Improve Suggest changes 42 Likes 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. Create Quiz useParams Hook in ReactJS Visit Course useParams Hook in ReactJS ReactJS useParams Hook Comment R raman111 Follow 42 Improve R raman111 Follow 42 Improve Article Tags : Web Technologies ReactJS React-Hooks Explore React FundamentalsReact Introduction6 min readReact Environment Setup3 min readReact JS ReactDOM2 min readReact JSX5 min readReactJS Rendering Elements3 min readReact Lists4 min readReact Forms4 min readReactJS Keys4 min readComponents in ReactReact Components4 min readReactJS Functional Components4 min readReact Class Components3 min readReactJS Pure Components4 min readReactJS Container and Presentational Pattern in Components2 min readReactJS PropTypes5 min readReact Lifecycle7 min readReact HooksReact Hooks8 min readReact useState Hook5 min readReactJS useEffect Hook5 min readRouting in ReactReact Router5 min readReact JS Types of Routers10 min read Advanced React ConceptsLazy Loading in React and How to Implement it ?4 min readReactJS Higher-Order Components5 min readCode Splitting in React4 min readReact ProjectsCreate ToDo App using ReactJS3 min readCreate a Quiz App using ReactJS4 min readCreate a Coin Flipping App using ReactJS3 min readHow to create a Color-Box App using ReactJS?4 min readDice Rolling App using ReactJS4 min readGuess the number with React3 min read Like