React router - Link is not defined

0 votes
117 views
added Apr 12, 2021 in React by lcjr First Warrant Officer (9,190 points)
{/^https?:\/\//.test(agencyURL)
? <a href={agencyURL} />
: <Link to={agencyURL} />
}

Add the following on top of your component

import { Link } from 'react-router';

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...