0

I just started with reactjs and I don't quite seem to understand how to use it with buttons. So I got these two buttons here

  <a className="button is-warning">
  Sign up
  </a>

  <a className="button is-warning">
  Login
  </a>

And I want them to link to

<Route path="/account" component={Account}/>
<Route path="/start" component={Start}/>

I know there are already quite a few questions and answers about this topic here and I also watched tutorials and try to figure it out, but still I can't seem to get into my head how to do it.

2 Answers 2

2

Use <Link> instead of <a>

<Link to="/account" className="button is-warning">Sign up</Link>
<Link to="/start" className="button is-warning">Login</Link>
Sign up to request clarification or add additional context in comments.

Comments

0

I also tried to use the component but that was throwing some error (don't remember which errors) but then I just tried to use the from react-router-dom and it worked like a charm.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.