Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
pass argument to string in Navigate Tag React router v6

I don't know how to use Navigate in React router v6. I'm trying to redirect to loggedPath if user is true. But i don't know syntax to pass loggedPath argument to <Navigate to = ${loggedPath} />

import { Route, Navigate } from "react-router-dom";


export function IsUserRedirect({ user, loggedPath, children, ...rest }){
    return (
       <Route
        {...rest}
        element ={ !user ? children : user && <Navigate to = `${loggedIath}` /> }
         />
    )}

and this is Error message

  • Parsing error: JSX value should be either an expression or a quoted
    JSX text
  • '{' expected.
  • Expression expected.
  • Unterminated regular expression literal.
  • Declaration or statement expected.

Thank you for help

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You have to wrap it in {} when you use ``

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!