Skip to content

Tag: http-status-code-404

404 page in REACT

I created the component NotFound and it works fine when I go to a page that doesn’t exist. But the same page it’s appearing in all my pages, not only the one that doesn’t exist. This is the component: And this is how I used it in the main page: As you can see I use <Route path=”*&#8…

react.js Replace img src onerror

I have a react component that is the detail view from a list. I am trying to replace the image with a default image if the image does not exist and there is a 404 error. I would normally use the onerror method in the img tag but that doesn’t seem to be working. I am not sure how to