1

When I clicked on the link, I got a 404 error in the production build of react js and showed an error on the firebase hosting website.

<Link target='_blank' to={'/property-details?id='some_id'}/>
Manav
  • 13
  • 1
  • 5
  • 2
    Does this answer your question? [React-Router open Link in new tab](https://stackoverflow.com/questions/30202755/react-router-open-link-in-new-tab) – Bishan Mar 23 '22 at 05:11

2 Answers2

1

To fix it, you can change your code to below.

<Link to="/home" target="_blank" rel="noopener noreferrer" />

Just add the rel attribute to fix it. This may also improve your page performance.


If you want to use the <a> tag instead, then you can use the following code.

<a href="https://stackoverflow.com/" target="_blank" rel="noreferrer noopener">Stack Overflow</a>

The rel attribute will improve page performance.

Arnav Thorat
  • 3,078
  • 3
  • 8
  • 33
0

That should be because you have an odd number of single quotes. Check your opening and closing quotes. From here, I can even see that the 'some_id' black color which is different from the rest of the letters when the are in quotes. They should be of the same color. I think that how I quickly figured out that the issue is probably from the single quotes.

Genius
  • 11
  • 1