how can I access this match.chatroomId in the functional component ??
I use history.replace to redirect to the component
onClick = {() => history.replace(`/chat/${match.chatroomId}`)}
using react hook useParams() This is url - http://localhost:8000/personal/1.
So in this case, use const { id } = useParams()
now, if you do console.log(id) , it will give you the exact id of the url. In this case it will give you 1.
useParams() extracts the id from the url and lets us use it.
Thanks.