to resolve this problem you muss use useParams() and use useEffect() if you want conection with API
const [user,setUser]=useState('');
let param=useParams();
param.id!=null ? useEffect(()=>{
getUserOne(param.id)
.then((res)=>setUser(res.data))enter code here
.catch(()=>console.log('there is wrong'));