3

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.

1
  • This react router or what? Commented Jul 28, 2015 at 23:58

1 Answer 1

1

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

ReactRouter.run(routes, hashlocation, (Handler) => {
  React.render(<Handler/>);
});
Sign up to request clarification or add additional context in comments.

6 Comments

The router defaults to hashlocation and is already using that from root. I don't believe you can sub-hash a hashlocation.
just create an ordinary link tag. tested and worked. also use historylocation. <a href="#idOfComponent>Show</a>
It seems Router.HistoryLocation only works when pairing with a server. I'm running a simple client-side app.
i dont get what you mean. how are you suppose to run react router without a server?
Related question in reference to your answer. Hoping you can help me clarify what different things are here. I'm using <Router history={browserHistory} /> so I don't get how I can relate what I"m using to your answer....what is hashLocation vs. historyLocation? I think I'm using historyLocation which is browserHistory???
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.