score:2

Accepted answer
 import {useHistory} from 'react-router-dom'
 
 const history = useHistory()
 const verify = ({router: {query}}) => {

     const router = useRouter()

     useEffect(() => {
      if(query.level === 'junior'){ history.push('/junior') }
  
      if(query.level === 'senior'){ history.push('/senior') }

      if(query.level === 'superSenior'){ history.push('/super-senior') }
     })

      return <h1>Loading...</h1>
}

Related Query

More Query from same tag