Home > Software design >  Link a text to specific url in React
Link a text to specific url in React

Time:12-06

I want to link a part of text to a url, in React. Here's an example of code.

{ abc ? <Random /> : 'Go to this page.'}

page needs to be linked to a specific url. Can anyone please help me with this?

CodePudding user response:

{ abc ? <Random /> : <Link to='/path'> Go to this page </Link>}

Hope this Helps It will Redirect you to the page you want.

CodePudding user response:

like this :

{  abc ? <Random /> : <a href="https://www.google.com">go to google</a>}
  • Related