<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone@7.14.7/babel.min.js"></script>
<script type="text/babel">
const { useState, useEffect } = React;
const [currentPathname, setCurrentPathname] = useState(window.location.pathname);
<div className='container'>
<h3 className='title'>React Js Get Current Pathname of URL</h3>
<p className='description'>Current Pathname: {currentPathname}</p>
ReactDOM.render(<App />, document.getElementById("app"));
font-family: Arial, sans-serif;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
/* Styles for the title */
/* Styles for the description */