I think you will have no problem
useParams
is not the react hook, it's officially provided by react-router-dom
So technically,it will process the slug with your component and provide it before that route code is loaded
you can do simple validation on backend or frontend
if(!slug) return