Jesvin Jose
Jesvin Jose

Reputation: 23088

How to trigger react-router without Link

I understand react-router has Link and clicking them reloads the entire page:

<Link to="/projects/123">

But in some cases I have raw HTML such as messages:

Hey dude, please complete <a href="https://example.com/projects/123">https://example.com/projects/123</a> and dont forget to close them

How do I give the same functionality to a tags?

Upvotes: 3

Views: 609

Answers (1)

edoloughlin
edoloughlin

Reputation: 5901

You could use the redirect method of the Transition object in the onclick handler for the anchor.

Upvotes: 2

Related Questions