I have a problem where I need to get some value from URL however I need to get this value in the first component to be rendered so this component is not inside any Route or something and I guess in this way I am not able to use useParams hook.
const bookSlug = location.pathname.split('/')[3];
I am getting the value from url like this right now and I don't think that this is a good way. Is there any other way?