Home > other >  How to use react route with href
How to use react route with href

Time:05-16

enter image description here

I tried this way and the problem is as follows...

CodePudding user response:

You are not linking it properly.

Try this:

<a href=`page/${person.id}` classaName="scam-title_link"></a>

Or use the Link tag provide by react-router-dom:

import {Link} from "react-router-dom";

<Link to=`page/${person.id}`>WHATEVER YOU WANT TO ADD HERE!</Link>

Check this reference for further understanding.

  • Related