ChadF
ChadF

Reputation: 1758

Using React-Router to link within a page

I'm trying to make an anchor tag which will link to a location within the same page (like this)

However React-Router hijacks that, and and routes me to nothing, as I haven't established that link in the hierarchy. So it sends me to the root location of that name, instead of a location on the same page.

Upvotes: 3

Views: 1634

Answers (1)

Rei Dien
Rei Dien

Reputation: 196

if i understand your question, you can use hashlocation instead of history location. like this

ReactRouter.run(routes, hashlocation, (Handler) => {
  React.render(<Handler/>);
});

Upvotes: 1

Related Questions